From: Vadim Zeitlin Date: Fri, 1 Dec 2000 01:13:20 +0000 (+0000) Subject: fix for enter processing of owner-drawn buttons X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3e79ed960a1c7cf83b945ad58f29162b85aca6b3 fix for enter processing of owner-drawn buttons git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8868 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index b19210ce93..12df591053 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1557,7 +1557,18 @@ bool wxWindow::MSWProcessMessage(WXMSG* pMsg) } else if ( lDlgCode & DLGC_BUTTON ) { - // buttons want process Enter themselevs + // let IsDialogMessage() handle this for all + // buttons except the owner-drawn ones which it + // just seems to ignore + long style = ::GetWindowLong(msg->hwnd, GWL_STYLE); + if ( (style & BS_OWNERDRAW) == BS_OWNERDRAW ) + { + // emulate the button click + wxWindow *btn = wxFindWinFromHandle((WXHWND)msg->hwnd); + if ( btn ) + btn->MSWCommand(BN_CLICKED, 0 /* unused */); + } + bProcess = FALSE; } else