Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 To: chris smith
  Where is chris smith?
 Yorkshire CH CH
 Barbados
 chris smith
 Tags
Subject: RE: getdir()
Thread ID: 419 Message ID: 420 # Views: 4 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Tuesday, May 29, 2001 9:24:10 AM         
   


> When I issue the getdir() command the select directory dialog box appears .However the drive combo only allows me to select the a,c,d from my machine. How can I make the network neighborhood option included in this combo?
>
> smith

Here you go. I dont remember who wrote it.

pShellMalloc = ""
DECLARE INTEGER SHGetMalloc IN SHELL32.DLL STRING @pShellMalloc


*-- SHBrowseForFolder returns a PIDL. Memory for the PIDL is
*-- allocated by the shell. This memory will need to be
*-- freed, so we need to get a pointer to the shell malloc.
NOERROR = 0
r = SHGetMalloc(@pShellMalloc)

IF r = NOERROR

*-- Create the BROWSEINFO structure. I'm using all default
*-- values, so just make it the correct size
sBrowseInfo = REPL(CHR(0),32)

DECLARE INTEGER SHBrowseForFolder IN SHELL32.DLL STRING @Browseinfo

*-- If the user selects a folder the return value
*-- will be a pointer to a folder, otherwise
*-- it will be NULL.
nPointerToFolder = SHBrowseForFolder(@sBrowseinfo)


*// Now get values from pointer *//


*-- Make sure buffer is large enough
MAX_PATH = 260
sBuffer = REPL(" ",MAX_PATH) &&// Will hold the path name

DECLARE INTEGER SHGetPathFromIDList IN SHELL32.DLL ;
INTEGER nPointerToFolder,;
STRING @sBuffer


IF nPointerToFolder > 0
= SHGetPathFromIDList(nPointerToFolder,@sBuffer)
WAIT WINDOW ALLTRIM(sBuffer)
ENDIF

*-- Free the PIDL. I don't know if this is
*-- the correct way to handles this.
RELEASE pShellMalloc

ENDIF

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts

ENTIRE THREAD

getdir() Posted by chris smith @ 5/29/2001 8:40:19 AM
RE: getdir() Posted by Eric den Doop @ 5/29/2001 9:24:10 AM
RE: getdir() Posted by Paul Michael @ 5/29/2001 9:29:19 AM