From cf2ff27f5f0a59b0b35becb7b0a79a483825a08c Mon Sep 17 00:00:00 2001 From: Gerard Patel Date: Wed, 14 Mar 2001 17:24:59 +0000 Subject: [PATCH] Recalculate menu sizes if WM_INITMENU has recreated/changed something. --- controls/menu.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/controls/menu.c b/controls/menu.c index f63e8d5b03c..2bb0c5dd68d 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -3016,8 +3016,20 @@ static BOOL MENU_InitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT wFlags) 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; } /*********************************************************************** -- 2.11.4.GIT