Enhance the SHBrowseForFolder API Function

Stephen Fonnesbeck

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
Browse for a Folder using SHBrowseForFolder API function with a callback function BrowseCallbackProc.

This Extends the functionality that was given in the MSDN Knowledge Base article Q179497 "HOWTO: Select a Directory Without the Common Dialog Control".

After reading the MSDN knowledge base article Q179378 "HOWTO: Browse for Folders from the Current Directory", I was able to figure out how to add a callback function that sets the starting directory and displays the currently selected path in the "Browse For Folder" dialog.

I used VB 6.0 (SP3) to compile this code. Should work in VB 5.0. However, because it uses the AddressOf operator this code will not work with versions below 5.0.

Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download ebrowsef.zip