Group: Shell Functions - Library: shell32
Displaying system dialog that selects a folder
Browsing Windows Known Folders (Special Folders)
LPITEMIDLIST SHBrowseForFolder(
LPBROWSEINFO lpbi
); DECLARE INTEGER SHBrowseForFolder IN shell32;
STRING @ lpbi lpbi [in, out] Pointer to a BROWSEINFO structure that contains information used to display the dialog box.
Returns a pointer to an item identifier list (PIDL) that specifies the location of the selected folder relative to the root of the namespace. If the user chooses the Cancel button in the dialog box, the return value is NULL.
Starting with VFP version 7 the original GETDIR function is changed to be a wrapper around the SHBrowseForFolder function.
The SHGetPathFromIDList will return the path of the selected folder.
Windows Shell script:
oShell = CREATEOBJECT("Shell.Application")
oFolder = oShell.Application.BrowseForFolder(_screen.HWnd,;
"Select Folder", 1, "c:\Program Files")
IF NOT ISNULL(oFolder)
? oFolder.self.Path
ENDIF
Home