]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
1. DoSetSize() simplified, DoGetBestSize() introduced
[wxWidgets.git] / src / msw / app.cpp
index 944714414d379b5096848165c5950d43c116c482..13b18068061c866d5e725fbf0948df7501e258f9 100644 (file)
@@ -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() )