sorry, i thought I pasted this in here.
SHBrowseForFolder
Displays a dialog box that enables the user to select a Shell folder.
LPITEMIDLIST SHBrowseForFolder(
LPBROWSEINFO lpbi
);
Parameters
lpbi
[in] Pointer to a BROWSEINFO structure that contains information used to display the dialog box.
Return Values
Returns a pointer to an ITEMIDLIST structure (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.
Remarks
You must initialize COM using CoInitializeEx with the COINIT_APARTMENTTHREADED flag on dwCoInit set prior to calling SHBrowseForFolder. You can also use CoInitialize or OLEInitialize, which always use apartment threading.
The calling application is responsible for freeing the returned PIDL with the Shell allocator's IMalloc::Free method. To retrieve a handle to the Shell allocator's IMalloc interface, call SHGetMalloc. See The Shell Namespace for further discussion of the Shell allocator and PIDLs.
There are two styles of dialog box available. The older style is displayed by default, and is not resizable. To specify a new-style dialog box, set the BIF_USENEWUI flag in the ulFlags member of the BROWSEINFO structure. It has a number of additional features, including: drag and drop capability within the dialog box, reordering, shortcut menus, new folders, delete, and other shortcut menu commands. Initially, it is larger than the old dialog box, but can be resized by the user.
If you implement a callback function, you will receive a handle to the dialog box. One use of this window handle is to modify the layout or contents of the dialog box. Because it is not resizable, modifying the old-style dialog box is relatively straightforward. Modifying the new-style dialog box is much more difficult, and not recommended. Not only does it have a different size and layout than the old style, but its dimensions and the positions of its controls change every time it is resized by the user.
If the BIF_RETURNONLYFSDIRS flag is set in the ulFlags member of the BROWSEINFO structure, the OK button will remain enabled for "\\server" items, as well as "\\server\share" and directory items. However, if the user selects a "\\server" item, passing the PIDL returned by the dialog box to SHGetPathFromIDList will fail.
See Also
Open and Save Common Dialog Boxes
Requirements
Version 4.00 and later of Shell32.dll
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98/Me: Requires Windows 95 or later.
Header: Declared in Shlobj.h.
Import Library: Shell32.lib.
bdiamond