From d9280fed84a0c7f0727e3c2cc0dece9f9e94b4e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Gouget?= <fgouget@codeweavers.com>
Date: Fri, 16 Feb 2001 19:38:32 +0000
Subject: [PATCH] TB_SETBUTTONSIZE messages must be taken into account even
 after buttons have been added.

---
 dlls/comctl32/toolbar.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 165da1079d7..7f69508e522 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -3248,17 +3248,12 @@ TOOLBAR_SetButtonSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
 	return FALSE;
     }
 
-    /* Button size can only be set before adding any button to the toolbar
-       according to the documentation.  */
-    /* this appears to be wrong. WINZIP32.EXE (ver 8) calls this on
-       one of its buttons after adding it to the toolbar, and it
-       checks that the return value is nonzero - mjm */
-    if( infoPtr->nNumButtons != 0 )
-    {
-        WARN("Button size set after button in toolbar\n");
-        return TRUE;
-    }
-
+    /* The documentation claims you can only change the button size before
+     * any button has been added. But this is wrong. 
+     * WINZIP32.EXE (ver 8) calls this on one of its buttons after adding 
+     * it to the toolbar, and it checks that the return value is nonzero - mjm
+     * Further testing shows that we must actually perform the change too.
+     */
     infoPtr->nButtonWidth = (INT)LOWORD(lParam);
     infoPtr->nButtonHeight = (INT)HIWORD(lParam);
     return TRUE;
-- 
GitLab