static CString GetDisplayName(LPCTSTR szFileName)
{
CSHFileInfo info;
UINT uFlags = SHGFI_DISPLAYNAME;
DWORD_PTR dwResult = ::SHGetFileInfo(szFileName, 0, &info, sizeof(info), uFlags);
if (dwResult == 0)
{
return CString();
}
return info.szDisplayName;
}
static CString GetDisplayName(LPCITEMIDLIST pidl)
{
CSHFileInfo info;
UINT uFlags = SHGFI_DISPLAYNAME | SHGFI_PIDL;
DWORD_PTR dwResult = ::SHGetFileInfo((LPCTSTR)pidl, 0, &info, sizeof(info), uFlags);
if (dwResult == 0)
{
return CString();
}
return info.szDisplayName;
}