user32: Do not return the class icon when ICON_SMALL2 is requested.

This commit is contained in:
Alex Henrie 2015-05-13 00:33:11 -06:00 committed by Alexandre Julliard
parent f4c5940656
commit f2bf0227a2
2 changed files with 7 additions and 2 deletions

View File

@ -640,8 +640,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
break;
case ICON_SMALL2:
ret = wndPtr->hIconSmall;
if (!ret) ret = (HICON)GetClassLongPtrW( hwnd, GCLP_HICONSM );
/* FIXME: should have a default here if class icon is null */
break;
default:
ret = 0;

View File

@ -1002,6 +1002,13 @@ static void test_icons(void)
hsmicon = (HICON)GetClassLongPtrW(hwnd, GCLP_HICONSM);
ok(hsmicon != NULL, "GetClassLong should return non-zero handle\n");
ok(SendMessageA(hwnd, WM_GETICON, ICON_BIG, 0) == 0,
"WM_GETICON with ICON_BIG should not return the class icon\n");
ok(SendMessageA(hwnd, WM_GETICON, ICON_SMALL, 0) == 0,
"WM_GETICON with ICON_SMALL should not return the class icon\n");
ok(SendMessageA(hwnd, WM_GETICON, ICON_SMALL2, 0) == 0,
"WM_GETICON with ICON_SMALL2 should not return the class icon\n");
hsmallnew = CopyImage(wcex.hIcon, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON), 0);
ok(!SetClassLongPtrW(hwnd, GCLP_HICONSM, (LONG_PTR)hsmallnew),