argh, another IsDialogMessage() fix: we still need to check all non top level parents

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-06-15 21:17:37 +00:00
parent 573a158618
commit 48c61225d6

View File

@@ -2084,16 +2084,27 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
// has WS_EX_CONTROLPARENT style, so don't call it in this case
bool canSafelyCallIsDlgMsg = TRUE;
HWND hwnd = ::GetFocus();
if ( hwnd && !(::IsWindowEnabled(hwnd) && ::IsWindowVisible(hwnd)) )
HWND hwndFocus = ::GetFocus();
while ( hwndFocus )
{
hwnd = ::GetParent(hwnd);
if ( hwnd &&
(::GetWindowLong(hwnd, GWL_STYLE) & WS_EX_CONTROLPARENT) )
if ( !::IsWindowEnabled(hwndFocus) ||
!::IsWindowVisible(hwndFocus) )
{
// it would enter an infinite loop if we do this!
canSafelyCallIsDlgMsg = FALSE;
break;
}
if ( !(::GetWindowLong(hwndFocus, GWL_STYLE) & WS_CHILD) )
{
// it's a top level window, don't go further -- e.g. even
// if the parent of a dialog is disabled, this doesn't
// break navigation inside the dialog
break;
}
hwndFocus = ::GetParent(hwndFocus);
}
if ( canSafelyCallIsDlgMsg && ::IsDialogMessage(GetHwnd(), msg) )