git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2876
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
HWND hWnd = msg->hwnd;
wxWindow *wndThis = wxFindWinFromHandle((WXHWND)hWnd), *wnd;
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() )
// Try translations first; find the youngest window with
// a translation table.
for ( wnd = wndThis; wnd; wnd = wnd->GetParent() )