| IShellFolder *psfParent; //A pointer to the parent folder object's IShellFolder interface LPITEMIDLIST pidlItem = NULL; //the item's PIDL LPITEMIDLIST pidlRelative = NULL; //the item's PIDL relative to the parent folder STRRET str; //the display name's STRRET structure TCHAR szDisplayName[MAX_PATH]; //the display name's string HRESULT hres = SHBindToParent(pidlItem, IID_IShellFolder, &psfParent, &pidlRelative); if(SUCCEEDED(hres)) { psfParent->GetDisplayNameOf(pidlRelative, SHGDN_NORMAL, &str); psfParent->Release(); StrRetToBuf(&str, pidlItem, szDisplayName, ARRAYSIZE(szDisplayName)); } |