Recalculate menu sizes if WM_INITMENU has recreated/changed something.
diff --git a/controls/menu.c b/controls/menu.c
index f63e8d5..2bb0c5d 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -3016,8 +3016,20 @@
SendMessageA( hWnd, WM_SETCURSOR, hWnd, HTCAPTION );
if (!(wFlags & TPM_NONOTIFY))
+ {
+ POPUPMENU *menu;
SendMessageA( hWnd, WM_INITMENU, hMenu, 0 );
-
+ if ((menu = MENU_GetMenu( hMenu )) && (!menu->Height))
+ { /* app changed/recreated menu bar entries in WM_INITMENU
+ Recalculate menu sizes else clicks will not work */
+ RECT r;
+ HDC hdc = GetDCEx( hWnd, 0, DCX_CACHE | DCX_WINDOW );
+ SelectObject( hdc, hMenuFont);
+ GetClientRect(hWnd, &r); /* probably too simple */
+ MENU_MenuBarCalcSize( hdc, &r, menu, hWnd );
+ ReleaseDC(hWnd, hdc);
+ }
+ }
return TRUE;
}
/***********************************************************************