bsegraves
bsegraves

Reputation: 1020

From code, how to get favorites explorer shortcuts in Windows 7

In Windows 7, there's a Favorites tree that appears in Explorer that the user can dynamically add items to.

How can I retrieve these shortcuts from code?

In c#, I know I can do the following:

Environment.GetFolderPath(Environment.SpecialFolder.Favorites)

but that seems to be an entirely different Favorites folder.

I've googled around but haven't found anything yet.

Upvotes: 0

Views: 675

Answers (1)

Anders
Anders

Reputation: 101569

You want FOLDERID_Links. I don't think there is a .net constant for this but you can PInvoke SHGetKnownFolderPath, use COM (CLSID_KnownFolderManager/IKnownFolderManager) or the .net WinAPI Codepack.

Upvotes: 1

Related Questions