Search code examples
c++windowswinapiwindows-7windows-shell

Windows 7 Libraries


I hope someone can help me with this, as I'm unable to find the right method to do it.

I am currently developing an application that should, in part, be able to enumerate all the Windows Libraries and display their contents.

For now, I am able to get the included folders for all the standard Windows 7 libraries (Documents, Pictures, Videos and Music, etc).

The problem is that I don't know how to get the info of custom user-defined Libraries, as the IShellLibrary::SHLoadLibraryFromKnownFolder() needs the specific folder GUID, which is not really defined in KnownFolders.h.

I only need to list all Libraries' names and fetch their respective GUIDs, if it's possible.


Solution

  • It seems like you can technically create a library definition file and place it anywhere on a system. Short of searching for all such definition files, perhaps you might consider limiting yourself to enumerating all shell items under the well-known shell folder FOLDERID_Libraries? The ID for this folder should be in KnownFolders.h in the latest version of the Windows SDK.

    For each shell item that you come across under this folder, you should be able to call SHLoadLibraryFromItem to "load" the library if you need access to an IShellLibrary object for it.