Get icons for shell link files.

This commit is contained in:
Martin Fuchs 2004-04-05 21:05:51 +00:00 committed by Alexandre Julliard
parent 27b1cf9ab1
commit d98c36c106
1 changed files with 27 additions and 4 deletions

View File

@ -259,6 +259,30 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(
found = TRUE;
}
else if (!strcasecmp(sTemp, "lnkfile"))
{
/* 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 */
{
@ -266,7 +290,6 @@ static HRESULT WINAPI IExtractIconW_fnGetIconLocation(
*piIndex = 0;
}
}
}
TRACE("-- %s %x\n", debugstr_w(szIconFile), *piIndex);
return NOERROR;