X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a71d815bbe669ebb9bdb9409926a272c37a5a9aa..4fe41ce6250fd9ba3632f532574e671839afb595:/src/msw/mdi.cpp?ds=sidebyside diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 89040acf21..bcb1467df6 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -807,6 +807,11 @@ bool wxMDIChildFrame::Show(bool show) if ( show ) ::BringWindowToTop(GetHwnd()); + // we need to refresh the MDI frame window menu to include (or exclude if + // we've been hidden) this frame + wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent(); + MDISetMenu(parent->GetClientWindow(), NULL, NULL); + return true; } @@ -1373,13 +1378,16 @@ void wxMDIChildFrame::OnIdle(wxIdleEvent& event) static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow) { - ::SendMessage(GetWinHwnd(win), WM_MDISETMENU, -#ifdef __WIN32__ - (WPARAM)hmenuFrame, (LPARAM)hmenuWindow -#else - 0, MAKELPARAM(hmenuFrame, hmenuWindow) -#endif - ); + if ( hmenuFrame || hmenuWindow ) + { + if ( !::SendMessage(GetWinHwnd(win), + WM_MDISETMENU, + (WPARAM)hmenuFrame, + (LPARAM)hmenuWindow) ) + { + wxLogLastError(_T("SendMessage(WM_MDISETMENU)")); + } + } // update menu bar of the parent window wxWindow *parent = win->GetParent();