From 7f68042c444d0e46ef63a6d6cc765937bb380991 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 20 May 1999 22:53:09 +0000 Subject: [PATCH] mysterious radiobox bug finally fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dialog.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index ec79f72f57..d1979b9a4e 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -310,7 +310,13 @@ bool wxDialog::Show(bool show) { if (show) { - m_hwndOldFocus = (WXHWND)::GetFocus(); + // find the top level window which had focus before - we will restore + // focus to it later + m_hwndOldFocus = 0; + for ( HWND hwnd = ::GetFocus(); hwnd; hwnd = ::GetParent(hwnd) ) + { + m_hwndOldFocus = (WXHWND)hwnd; + } if (m_modalShowing) { -- 2.47.2