There seem to be a few virtual folders which have GUIDs associated to them (control panel, desktop) -
::{00021400-0000-0000-c000-000000000046} // desktop
Where the blazes are these defined? When are they used?
What I want is a way to have a string which represents a virtual folder without any ambiguity.
If, for instance, I were to create a PIDL for the desktop, the display name comes back as "C:\Users\Steve\Desktop".
Well, that's true at the moment - but its not really the correct folder. I can navigate in Explorer to that folder, and it contains a portion of the files on my desktop, not the entire desktop.
What I want is a way to encode that location as a string that will always navigate to the virtual desktop folder (the one that has all of its contents, not just a few things).
Does anyone know of a definitive list of such GUIDs? Or how I might convert a given PIDL into one?
I tried SHGetDisplayName(pidl, SHGDN_*) - every version of that for the desktop pidl gives me either a short "Desktop" or "C:\Users\Steve\Desktop". (I'm logged in under the 'steve' account, obviously).
Ideas / comments / pointers?
EDIT: So it seems that I can use the given answers below to have a list of Known Folder GUIds. But does anyone know programatically how to convert from a PIDL -> known folder GUID? I assume that I can ParseDisplayName("::{guid}") to get the PIDL, but is there a way to get to the GUID?
EDIT2: I still cannot find a way to get to the GUID programatically. However, for my purposes, I am recording the CSIDL_xxx that I use to create the object initially, and write that out & restore it later, and then create a PIDL by way of the CSIDL, which retains its correct identity (ie. it doesn't degrade into "C:\Users\\Desktop" but rather generates a PIDL that really points to the virtual desktop.
The trick for me is to always use the CSIDL->PIDL, never going to a string in between. CSIDL->PIDL->string->PIDL = degeneration into non-virtual path.
Thanks everyone for the help - and I'll keep looking if anyone finds more on the subject and posts it, I'd be interested! ;)