diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 9e1090e929..7e9273c964 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -987,47 +987,6 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara } break; #endif // !__WXMICROWIN__ - -#if wxUSE_MENUS - case WM_INITMENUPOPUP: - { - wxMenuBar* const bar = GetMenuBar(); - if ( bar && !bar->IsEnabledTop(LOWORD(lParam)) ) - { - // Skip sending of wxEVT_MENU_OPEN in the base class - // MSWWindowProc() for disabled top level menus. - return MSWDefWindowProc(message, wParam, lParam); - } - } - break; - - case WM_UNINITMENUPOPUP: - { - wxMenuBar* const bar = GetMenuBar(); - if ( !bar ) - break; - - // Unlike in WM_INITMENUPOPUP above, we don't have the position - // of the menu in the message itself, so find it ourselves. - const HMENU hmenu = (HMENU)wParam; - - const size_t count = bar->GetMenuCount(); - for ( size_t n = 0; n < count; n++ ) - { - wxMenu* const menu = bar->GetMenu(n); - if ( GetHmenuOf(menu) == hmenu ) - { - if ( !bar->IsEnabledTop(n) ) - { - // If we skipped sending wxEVT_MENU_OPEN, don't - // send wxEVT_MENU_CLOSE neither. - return MSWDefWindowProc(message, wParam, lParam); - } - } - } - } - break; -#endif // wxUSE_MENUS } #if wxUSE_TASKBARBUTTON if ( message == wxMsgTaskbarButtonCreated )