Handle WM_*MENU* events in wxWindow.

Contrary to MSDN implications, at least some of these messages are not
actually sent to the TLW for popup menus, but to the owning window or
even its parent window (!).

Catch the events in wxWindow and forward to the TLW.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2014-06-18 12:57:26 +00:00
parent 3c2eea9f92
commit 09c05de725

View File

@@ -3491,6 +3491,26 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
}
}
break;
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
case WM_INITMENUPOPUP:
case WM_MENUSELECT:
case WM_EXITMENULOOP:
case WM_UNINITMENUPOPUP:
{
// Contrary to MSDN implications, at least some of these messages are
// not actually sent to the TLW for popup menus, but to the owning
// window or even its parent window.
//
// wx-3.1+ handles these messages in wxWindow instead, but binary
// compatibility requirements on wx-3.0 make it simpler to just forward
// the messages to the wxTLW.
wxWindow *tlw = wxGetTopLevelParent(this);
if ( tlw && tlw != this )
processed = tlw->MSWWindowProc(message, wParam, lParam);
}
break;
#endif // !__WXMICROWIN__
#endif // wxUSE_MENUS
#ifndef __WXWINCE__