X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/837e57436a89516a5fa9f478f401e06bd872c17c..4438caf41af49f00f3c8137ac801871f59cce386:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 944714414d..13b1806806 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -86,7 +86,6 @@ #include "wx/msw/msvcrt.h" - // --------------------------------------------------------------------------- // global variables // --------------------------------------------------------------------------- @@ -924,6 +923,15 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg) HWND hWnd = msg->hwnd; wxWindow *wndThis = wxFindWinFromHandle((WXHWND)hWnd), *wnd; + // for some composite controls (like a combobox), wndThis might be NULL + // because the subcontrol is not a wxWindow, but only the control itself + // is - try to catch this case + while ( hWnd && !wndThis ) + { + hWnd = ::GetParent(hWnd); + wndThis = wxFindWinFromHandle((WXHWND)hWnd); + } + // Try translations first; find the youngest window with // a translation table. for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )