我希望有人可以帮助我,因为我无法找到正确的方法。
我目前正在开发一个应用程序,该应用程序应该能够枚举所有 Windows 库并显示其内容。
目前,我可以获得所有标准 Windows 7 库(文档、图片、视频和音乐等)的包含文件夹。
问题是我不知道如何获取自定义用户定义库的信息,因为 IShellLibrary::SHLoadLibraryFromKnownFolder()
需要特定的文件夹 GUID
,这并未在 KnownFolders.h
中真正定义。
如果可能的话,我只需要列出所有库的名称并获取它们各自的 GUID。
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 GUID
s, if it's possible.
发布评论
评论(1)
从技术上来说,您似乎可以创建一个库定义文件并将其放置在系统上的任何位置。如果无法搜索所有这样的定义文件,也许您可能会考虑将自己限制为枚举众所周知的 shell 文件夹
FOLDERID_Libraries
下的所有 shell 项?此文件夹的 ID 应位于最新版本 Windows SDK 的KnownFolders.h
中。对于此文件夹下遇到的每个 shell 项目,您应该能够调用 IShellLibrary 对象,请使用“nofollow noreferrer">
SHLoadLibraryFromItem
“加载”该库。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 inKnownFolders.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 anIShellLibrary
object for it.