fix for calling GetWindowLong(NULL hwnd)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-08-24 22:16:42 +00:00
parent c638c3cd12
commit de7f086027

View 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