Get icons for shell link files.
This commit is contained in:
parent
27b1cf9ab1
commit
d98c36c106
|
@ -259,13 +259,36 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(
|
||||||
|
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
}
|
}
|
||||||
|
else if (!strcasecmp(sTemp, "lnkfile"))
|
||||||
if (!found) /* default icon */
|
|
||||||
{
|
{
|
||||||
lstrcpynW(szIconFile, swShell32Name, cchMax);
|
/* extract icon from shell shortcut */
|
||||||
*piIndex = 0;
|
IShellFolder* dsf;
|
||||||
|
IShellLinkW* psl;
|
||||||
|
|
||||||
|
if (SUCCEEDED(SHGetDesktopFolder(&dsf)))
|
||||||
|
{
|
||||||
|
HRESULT hr = IShellFolder_GetUIObjectOf(dsf, NULL, 1, (LPCITEMIDLIST*)&This->pidl, &IID_IShellLinkW, NULL, (LPVOID*)&psl);
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr))
|
||||||
|
{
|
||||||
|
hr = IShellLinkW_GetIconLocation(psl, szIconFile, MAX_PATH, piIndex);
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr) && *szIconFile)
|
||||||
|
found = TRUE;
|
||||||
|
|
||||||
|
IShellLinkW_Release(psl);
|
||||||
|
}
|
||||||
|
|
||||||
|
IShellFolder_Release(dsf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found) /* default icon */
|
||||||
|
{
|
||||||
|
lstrcpynW(szIconFile, swShell32Name, cchMax);
|
||||||
|
*piIndex = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("-- %s %x\n", debugstr_w(szIconFile), *piIndex);
|
TRACE("-- %s %x\n", debugstr_w(szIconFile), *piIndex);
|
||||||
|
|
Loading…
Reference in New Issue