else if (!lstrcmpiA(sTemp, "lnkfile"))
{
/* extract icon from shell shortcut */
- CComPtr<IShellFolder> dsf;
CComPtr<IShellLinkW> psl;
- if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
- {
- HRESULT hr = dsf->GetUIObjectOf(NULL, 1, &pidl, IID_NULL_PPV_ARG(IShellLinkW, &psl));
+ HRESULT hr = psf->GetUIObjectOf(NULL, 1, &pidl, IID_NULL_PPV_ARG(IShellLinkW, &psl));
- if (SUCCEEDED(hr))
- {
- hr = psl->GetIconLocation(wTemp, MAX_PATH, &icon_idx);
+ if (SUCCEEDED(hr))
+ {
+ hr = psl->GetIconLocation(wTemp, MAX_PATH, &icon_idx);
- if (SUCCEEDED(hr) && *sTemp)
- found = TRUE;
+ if (SUCCEEDED(hr) && *sTemp)
+ found = TRUE;
- }
}
}
}