From: Vadim Zeitlin Date: Mon, 29 Jan 2001 17:43:53 +0000 (+0000) Subject: fix (?) for MDI children style problems X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/47ca6bfb051e90c745812a4f93f38b680f796942?ds=sidebyside fix (?) for MDI children style problems git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/changes.txt b/docs/changes.txt index 82dea25942..8b7de0efe6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -16,6 +16,7 @@ wxBase: wxMSW: - threads: bug in wxCondition::Broadcast fixed (Pieter van der Meulen) +- fixed bug in MDI children flags (mis)handling 2.2.0 ----- diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 2aa8a208f7..8ce7cfc8e9 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -1088,7 +1088,8 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect) wxMDIChildFrame* pChild = pFrameWnd->GetActiveChild(); if (!pChild || (pChild == this)) { - DWORD dwStyle = ::GetWindowLong(GetWinHwnd(pFrameWnd->GetClientWindow()), GWL_EXSTYLE); + HWND hwndClient = GetWinHwnd(pFrameWnd->GetClientWindow()); + DWORD dwStyle = ::GetWindowLong(hwndClient, GWL_STYLE); DWORD dwThisStyle = ::GetWindowLong(GetHwnd(), GWL_STYLE); DWORD dwNewStyle = dwStyle; if (pChild != NULL && (dwThisStyle & WS_MAXIMIZE)) @@ -1098,15 +1099,16 @@ bool wxMDIChildFrame::ResetWindowStyle(void *vrect) if (dwStyle != dwNewStyle) { - HWND hwnd = GetWinHwnd(pFrameWnd->GetClientWindow()); - ::RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN); - ::SetWindowLong(hwnd, GWL_EXSTYLE, dwNewStyle); - ::SetWindowPos(hwnd, NULL, 0, 0, 0, 0, + // force update of everything + ::RedrawWindow(hwndClient, NULL, NULL, + RDW_INVALIDATE | RDW_ALLCHILDREN); + ::SetWindowLong(hwndClient, GWL_EXSTYLE, dwNewStyle); + ::SetWindowPos(hwndClient, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOCOPYBITS); if (rect) - ::GetClientRect(hwnd, rect); + ::GetClientRect(hwndClient, rect); return TRUE; }