From: Vadim Zeitlin Date: Wed, 10 Jul 2013 12:24:54 +0000 (+0000) Subject: Ignore WM_MENUSELECT messages indicating that the menu was closed. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a98d0574342fdb01f52cae0779ed068d2559660d?ds=inline Ignore WM_MENUSELECT messages indicating that the menu was closed. Don't update the help string in this case, this is not necessary and can clear the help string set elsewhere. See #15315. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 93f05893b2..82b7c4d13c 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -1478,8 +1478,15 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) #if wxUSE_MENUS bool -wxTopLevelWindowMSW::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU WXUNUSED(hMenu)) +wxTopLevelWindowMSW::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) { + // Ignore the special messages generated when the menu is closed (this is + // the only case when the flags are set to -1), in particular don't clear + // the help string in the status bar when this happens as it had just been + // restored by the base class code. + if ( !hMenu && flags == 0xffff ) + return false; + // sign extend to int from unsigned short we get from Windows int item = (signed short)nItem;