mirror of
https://github.com/reactos/reactos.git
synced 2026-06-08 08:52:59 +08:00
[SHELL32] Get PerceivedType default icon (#8627)
Related to #8626. Display the correct icon. JIRA issue: CORE-19355 - Modify CFSExtractIcon_CreateInstance function to load PerceivedType default icon.
This commit is contained in:
committed by
GitHub
parent
69f10f6d38
commit
efca5040cb
@@ -346,7 +346,17 @@ HRESULT CFSExtractIcon_CreateInstance(IShellFolder * psf, LPCITEMIDLIST pidl, RE
|
||||
LPCWSTR pExtension = ExtensionFromPidl(pidl, extbuf, _countof(extbuf));
|
||||
HKEY hkey = pExtension ? OpenKeyFromFileType(pExtension, L"DefaultIcon") : NULL;
|
||||
if (!hkey)
|
||||
WARN("Could not open DefaultIcon key!\n");
|
||||
{
|
||||
DWORD dwSize = sizeof(wTemp);
|
||||
if (RegGetValueW(HKEY_CLASSES_ROOT, pExtension, L"PerceivedType", RRF_RT_REG_SZ, NULL,
|
||||
wTemp, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
WCHAR szSubKey[MAX_PATH];
|
||||
StringCchPrintfW(szSubKey, _countof(szSubKey),
|
||||
L"SystemFileAssociations\\%s\\DefaultIcon", wTemp);
|
||||
RegOpenKeyExW(HKEY_CLASSES_ROOT, szSubKey, 0, KEY_READ, &hkey);
|
||||
}
|
||||
}
|
||||
|
||||
DWORD dwSize = sizeof(wTemp);
|
||||
if (hkey && !SHQueryValueExW(hkey, NULL, NULL, NULL, wTemp, &dwSize))
|
||||
|
||||
Reference in New Issue
Block a user