Cyril O'Floinn has wrapped function SHBrowseForFolder into a higher-level DLL function, named BrowseForFolder. This has the advantage of being able to specify an initial directory.
The source for this new function is written in Delphi and is added to PROEXTRA.DLL.
The declaration is added to PROEXTRA.P and looks like this:
PROCEDURE BrowseForFolder EXTERNAL {&ProExtra} : DEFINE INPUT PARAMETER hWndOwner AS LONG. DEFINE INPUT PARAMETER lpTitle AS CHARACTER. DEFINE INPUT PARAMETER uiFlags AS LONG. DEFINE INPUT PARAMETER lpInitialFolder AS CHARACTER. DEFINE OUTPUT PARAMETER lpFolder AS CHARACTER. DEFINE RETURN PARAMETER BoolRetVal AS LONG. END PROCEDURE.
PROEXTRA.DLL and PROEXTRA.P are part of 'everything.zip' November 29, 1998 and can be downloaded from page windows.i and hpApi.
Cyril also made an example procedure, demonstrating the options of this function. This example is attached.
folder.w.zip : example