Winapi: programatically obtain path of special folder given its CLSID as string -
Does the Windows API offer any way to get a special folder path (i.e. my document), whose CLSID Used as a string (i.e.:: {450d8fba-ad25-11d0-98a8-0800361b1103})? Can it be done in any way? Additionally, it should be done with functions supported under Windows XP.
Thank you in advance.
The basic API If PIDL contains a string form (as is your example, because it resolves the documents folder), you can use SHParseDisplayName required for you. This will take the form path to
:: GUID} and convert it to PIDL.
SHGetPathFromIDList to change it.
LPITEMIDLIST pidl; If (SUCCEEDED (SHParseDisplayName (L ":: {450d8fba-ad25-11d0-98a8-0800361b1103}", nullptr, and pidl, 0, nullptr))) {wchar_t wchPath [MAX_PATH]; If (SUCCEEDED (SHGetPathFromIDList (pidl, wchPath))) {// the string form of the path is now wchPath} in ILFree (pidl); }
Comments
Post a Comment