Check out http://www.codeoftheweek.com/powerfindpro for a great time-saving add-in for Visual Basic.
View back issues of Code of the Week online at http://www.codeoftheweek.com/issues
See our web site http://www.codeoftheweek.com/links/specialoffer.html for an exciting subscription offer. You do not want to miss this one.
This issue was designed for VB 4.0 32-bit and up. Questions? Email us at firstname.lastname@example.org.
The complete source code appears near the end of this issue. Be sure not to miss it!
This issue is an enhancement to issue number 24. This issue enhances the cRegistryUtils class by adding the ability to get information about the Explorer shell folders.
The function added to cRegistryUtils is called ShellFolderPath. All the rest of the functions included in the cRegistryUtils class are documented in Issue #24 - http://www.codeoftheweek.com/issues/0024.html
The Explorer shell folders are various system folders that contain items like the Programs folder on the Start Menu, Favorites shortcuts and the location of the My Documents folder. You can use this shell folder information to enhance your system by adding your own icons to the Send To menu or removing items from the Recently use listing. Some useful shell folders are:
There is one new function called ShellFolderPath.
Public Function ShellFolderPath(sFolderName As String) As Variant
Returns the actual pathname of the Explorer shell folder name (see some of the examples in the Sample Usage section below). If an error occurs a value of Empty will be returned.
Below is an example of how this function works.
Dim Reg As New cRegistryUtils Debug.Print Reg.ShellFolderPath("SendTo") ' on this system the above line printed out: C:\WINDOWS\SendTo Debug.Print Reg.ShellFolderPath("Cache") ' on this system the above line printed out: C:\WINDOWS\Temporary Internet Files Debug.Print Reg.ShellFolderPath("Personal") ' on this system the above line printed out: C:\My Documents
To see the source code for this issue you must be a subscriber to Code of the Week. If you are a subscriber the source code is available at the following address: http://www.codeoftheweek.com/membersonly/bi/0064.html