diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c index bfcbd670dd0..7c8badef380 100644 --- a/dlls/comctl32/tests/toolbar.c +++ b/dlls/comctl32/tests/toolbar.c @@ -149,6 +149,7 @@ static void test_add_bitmap(void) TBADDBITMAP bmp128; TBADDBITMAP bmp80; TBADDBITMAP stdsmall; + TBADDBITMAP addbmp; INT ret; /* empty 128x15 bitmap */ @@ -240,6 +241,36 @@ static void test_add_bitmap(void) UpdateWindow(hToolbar); CHECK_IMAGELIST_TODO_COUNT_SIZE(28, 16, 15); + /* check standard bitmaps */ + addbmp.hInst = HINST_COMMCTRL; + addbmp.nID = IDB_STD_SMALL_COLOR; + rebuild_toolbar(&hToolbar); + ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); + CHECK_IMAGELIST(15, 16, 15); + addbmp.nID = IDB_STD_LARGE_COLOR; + rebuild_toolbar(&hToolbar); + ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); + CHECK_IMAGELIST(15, 24, 24); + + addbmp.nID = IDB_VIEW_SMALL_COLOR; + rebuild_toolbar(&hToolbar); + ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); + CHECK_IMAGELIST(12, 16, 15); + addbmp.nID = IDB_VIEW_LARGE_COLOR; + rebuild_toolbar(&hToolbar); + ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); + CHECK_IMAGELIST(12, 24, 24); + + addbmp.nID = IDB_HIST_SMALL_COLOR; + rebuild_toolbar(&hToolbar); + ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); + CHECK_IMAGELIST(5, 16, 15); + addbmp.nID = IDB_HIST_LARGE_COLOR; + rebuild_toolbar(&hToolbar); + ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n"); + CHECK_IMAGELIST(5, 24, 24); + + DestroyWindow(hToolbar); } diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 840a08a1d36..b6b82cd2a23 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -2591,7 +2591,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam) if ((lpAddBmp->nID & ~1) == IDB_STD_SMALL_COLOR) nButtons = 15; else if ((lpAddBmp->nID & ~1) == IDB_VIEW_SMALL_COLOR) - nButtons = 13; + nButtons = 12; else if ((lpAddBmp->nID & ~1) == IDB_HIST_SMALL_COLOR) nButtons = 5; else