mirror of
https://github.com/reactos/reactos.git
synced 2026-06-09 01:12:59 +08:00
[SHELL32] Set default exe icon (#2076)
The default icon of an exe file was empty if no icon available from exe. CORE-10480
This commit is contained in:
committed by
GitHub
parent
db5a2fff5d
commit
399854ce31
@@ -138,6 +138,21 @@ HRESULT STDMETHODCALLTYPE CExtractIcon::SetNormalIcon(
|
||||
{
|
||||
TRACE("(%p, %s, %d)\n", this, debugstr_w(pszFile), iIcon);
|
||||
|
||||
if (lstrcmpiW(PathFindExtensionW(pszFile), L".exe") == 0)
|
||||
{
|
||||
if (!PrivateExtractIconExW(pszFile, 0, NULL, NULL, 1))
|
||||
{
|
||||
WCHAR szPath[MAX_PATH];
|
||||
GetModuleFileNameW(shell32_hInstance, szPath, _countof(szPath));
|
||||
DuplicateString(szPath, &normalIcon.file);
|
||||
if (!normalIcon.file)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
normalIcon.index = -IDI_SHELL_EXE;
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
DuplicateString(pszFile, &normalIcon.file);
|
||||
if (!normalIcon.file)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
Reference in New Issue
Block a user