From aae032a0a903bb55e4682e602f429ef1a2ee0ef8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Apr 2002 22:29:16 +0000 Subject: [PATCH] don't let IsDialogMessage() have VK_ESCAPE, this fixes closing the tree in place editor with Escape git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 8bb6886ec3..77589902e5 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2036,10 +2036,18 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) } #endif // 1/0 - if ( ::IsDialogMessage(GetHwnd(), msg) ) + // we handle VK_ESCAPE ourselves in wxDialog::OnCharHook() and we + // shouldn't let IsDialogMessage() get it as it _always_ eats the + // message even when there is no cancel button and when the message is + // needed by the control itself: in particular, it prevents the tree in + // place edit control from being closed with Escape in a dialog + if ( msg->message != WM_KEYDOWN || msg->wParam != VK_ESCAPE ) { - // IsDialogMessage() did something... - return TRUE; + if ( ::IsDialogMessage(GetHwnd(), msg) ) + { + // IsDialogMessage() did something... + return TRUE; + } } } #endif // __WXUNIVERSAL__ -- 2.45.2