PRB: IShellFolder::GetDisplayNameOf Returns Names with GUIDsID: Q198871
|
On Windows 2000 Professional Edition, calling the desktop's IShellFolder::GetDisplayNameOf with SHGDN_FORPARSING for a namespace extension returns a name with GUIDs in it rather than actual display names.
For example, the following code:
LPITEMIDLIST pidl = NULL;
SHGetSpecialFolderLocation(NULL, CSIDL_CONTROLS, &pidl);
if(pidl)
{
IShellFolder *pDesktop;
SHGetDesktopFolder(&pDesktop);
if(pDesktop)
{
STRRET str;
TCHAR szText[MAX_PATH];
pDesktop->GetDisplayNameOf( pidl,
SHGDN_FORPARSING,
&str);
pDesktop->Release();
}
}
::{<GUID for My Computer>}\{<GUID for Control Panel>}rather than the following expected text:
Control PanelSome folders may return a name such as:
My Computer\::{GUID for the requested item}instead of returning the GUID for "My Computer."
This behavior is due to a design change in the Windows 2000 Professional Edition's desktop.
To retrieve the actual display text, you need to add the SHGDN_FORADDRESSBAR flag to the SHGDN_FORPARSING flag. If this is done in the sample code above, the text returned will be:
Control Panel
This behavior is by design.
Additional query words:
Keywords : kbNameSpace kbWinOS2000 kbSDKPlatform kbGrpShell
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: January 17, 1999