Skip to content
Snippets Groups Projects
Commit d98c36c1 authored by Martin Fuchs's avatar Martin Fuchs Committed by Alexandre Julliard
Browse files

Get icons for shell link files.

parent 27b1cf9a
No related branches found
No related tags found
No related merge requests found
......@@ -259,13 +259,36 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(
found = TRUE;
}
if (!found) /* default icon */
else if (!strcasecmp(sTemp, "lnkfile"))
{
lstrcpynW(szIconFile, swShell32Name, cchMax);
*piIndex = 0;
/* extract icon from shell shortcut */
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment