]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for calling GetWindowLong(NULL hwnd)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 24 Aug 2001 22:16:42 +0000 (22:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 24 Aug 2001 22:16:42 +0000 (22:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/app.cpp

index a0c1e2cda053e9716a7131d69fb0006899a5d0b8..7297d4c352cb689a5781b316029f7d6e5ab305fd 100644 (file)
@@ -1156,12 +1156,12 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg)
         // we need to find the dialog containing this control as
         // IsDialogMessage() just eats all the messages (i.e. returns TRUE for
         // them) if we call it for the control itself
-        while ( ::GetWindowLong(hwnd, GWL_STYLE) & WS_CHILD )
+        while ( hwnd && ::GetWindowLong(hwnd, GWL_STYLE) & WS_CHILD )
         {
             hwnd = ::GetParent(hwnd);
         }
 
-        return ::IsDialogMessage(hwnd, msg) != 0;
+        return hwnd && ::IsDialogMessage(hwnd, msg) != 0;
     }
 
 #if wxUSE_TOOLTIPS