From: Mark Harmstone Subject: [PATCH] shell32: Don't hardcode icon sizes in SIC_LoadIcon. Message-Id: <55BCDA45.3010008@burntcomma.com> Date: Sat, 1 Aug 2015 15:40:05 +0100 The shell icon image lists are created with their size as SM_CXICON or SM_CXSMICON, but when this is populated in SIC_LoadIcon the hardcoded values of 32 and 16 are used instead. --- dlls/shell32/iconcache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/iconcache.c b/dlls/shell32/iconcache.c index b294908..4549d5b 100644 --- a/dlls/shell32/iconcache.c +++ b/dlls/shell32/iconcache.c @@ -310,8 +310,10 @@ static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags) HICON hiconLargeShortcut; HICON hiconSmallShortcut; - PrivateExtractIconsW( sSourceFile, dwSourceIndex, 32, 32, &hiconLarge, 0, 1, 0 ); - PrivateExtractIconsW( sSourceFile, dwSourceIndex, 16, 16, &hiconSmall, 0, 1, 0 ); + PrivateExtractIconsW( sSourceFile, dwSourceIndex, GetSystemMetrics(SM_CXICON), + GetSystemMetrics(SM_CYICON), &hiconLarge, 0, 1, 0 ); + PrivateExtractIconsW( sSourceFile, dwSourceIndex, GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), &hiconSmall, 0, 1, 0 ); if ( !hiconLarge || !hiconSmall) {