Improve Win10 application icons
@@ -677,6 +677,8 @@ VOID PhGetStockApplicationIcon(
// fails the other threads.
if (PhBeginInitOnce(&initOnce))
+ {
+ if (WindowsVersion < WINDOWS_10)
{
PPH_STRING systemDirectory;
PPH_STRING dllFileName;
@@ -689,17 +691,8 @@ VOID PhGetStockApplicationIcon(
PH_STRINGREF dllBaseName;
ULONG index;
- // TODO: Find a better solution.
- if (WindowsVersion >= WINDOWS_10)
- {
- PhInitializeStringRef(&dllBaseName, L"\\imageres.dll");
- index = 11;
- }
- else
- {
PhInitializeStringRef(&dllBaseName, L"\\user32.dll");
index = 0;
- }
dllFileName = PhConcatStringRef2(&systemDirectory->sr, &dllBaseName);
PhDereferenceObject(systemDirectory);
@@ -707,6 +700,7 @@ VOID PhGetStockApplicationIcon(
ExtractIconEx(dllFileName->Buffer, index, &largeIcon, &smallIcon, 1);
PhDereferenceObject(dllFileName);
}
+ }
// Fallback icons
if (!smallIcon)
