Commit 734dc8f2 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

shell32: Use the imagelist to determine the icon size.

parent 524e316a
...@@ -298,6 +298,17 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI ...@@ -298,6 +298,17 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI
LeaveCriticalSection(&SHELL32_SicCS); LeaveCriticalSection(&SHELL32_SicCS);
return ret; return ret;
} }
static BOOL get_imagelist_icon_size(int list, SIZE *size)
{
HIMAGELIST image_list;
if (list < SHIL_LARGE || list > SHIL_SMALL) return FALSE;
image_list = (list == SHIL_LARGE) ? ShellBigIconList : ShellSmallIconList;
return ImageList_GetIconSize( image_list, &size->cx, &size->cy );
}
/**************************************************************************** /****************************************************************************
* SIC_LoadIcon [internal] * SIC_LoadIcon [internal]
* *
...@@ -311,11 +322,12 @@ static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags) ...@@ -311,11 +322,12 @@ static INT SIC_LoadIcon (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags)
HICON hiconLargeShortcut; HICON hiconLargeShortcut;
HICON hiconSmallShortcut; HICON hiconSmallShortcut;
int ret; int ret;
SIZE size;
PrivateExtractIconsW( sSourceFile, dwSourceIndex, GetSystemMetrics(SM_CXICON), get_imagelist_icon_size( SHIL_LARGE, &size );
GetSystemMetrics(SM_CYICON), &hiconLarge, 0, 1, 0 ); PrivateExtractIconsW( sSourceFile, dwSourceIndex, size.cx, size.cy, &hiconLarge, 0, 1, 0 );
PrivateExtractIconsW( sSourceFile, dwSourceIndex, GetSystemMetrics(SM_CXSMICON), get_imagelist_icon_size( SHIL_SMALL, &size );
GetSystemMetrics(SM_CYSMICON), &hiconSmall, 0, 1, 0 ); PrivateExtractIconsW( sSourceFile, dwSourceIndex, size.cx, size.cy, &hiconSmall, 0, 1, 0 );
if ( !hiconLarge || !hiconSmall) if ( !hiconLarge || !hiconSmall)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment