From affd3b90f90b326d7237bf0b7002f5166717d4e6 Mon Sep 17 00:00:00 2001
From: Anatoly Lyutin <vostok@etersoft.ru>
Date: Thu, 7 Aug 2008 13:36:04 +0400
Subject: [PATCH] Improved switching with mdi child windows ( Bug 495 )

---
 dlls/user32/mdi.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c
index 70490e3..8bffeb0 100644
--- a/dlls/user32/mdi.c
+++ b/dlls/user32/mdi.c
@@ -529,7 +529,14 @@ static void MDI_SwitchActiveChild( MDICLIENTINFO *ci, HWND hwndTo, BOOL activate
 
         if (was_zoomed)
         {
+            WINDOWPLACEMENT wndpl;
+            RECT    rect;
+
             ci->hwndChildMaximized = hwndTo;
+
+            GetWindowPlacement( hwndPrev, &wndpl );
+            rect = wndpl.rcNormalPosition;
+
             /* maximize new MDI child */
             ShowWindow( hwndTo, SW_MAXIMIZE );
             /* activate new MDI child */
@@ -537,7 +544,17 @@ static void MDI_SwitchActiveChild( MDICLIENTINFO *ci, HWND hwndTo, BOOL activate
 
             /* restore old MDI child */
             SendMessageW( hwndPrev, WM_SETREDRAW, FALSE, 0 );
-            ShowWindow( hwndPrev, SW_RESTORE );
+
+            /* Help with eterbug # 495*/
+            LOADETER_FUNC(etersoft_1version);
+            if ( etersoft_1version && etersoft_1version() == 7 )
+            {
+                SetWindowLongW( hwndPrev, GWL_STYLE, GetWindowLongW( hwndPrev, GWL_STYLE )&~WS_MAXIMIZE );
+                SetWindowPos( hwndPrev, HWND_BOTTOM, rect.left, rect.top, rect.right-rect.left, rect.bottom - rect.top, SWP_NOACTIVATE );
+            }
+            else
+                ShowWindow( hwndPrev, SW_RESTORE );
+
             SendMessageW( hwndPrev, WM_SETREDRAW, TRUE, 0 );
 
             ci->hwndActiveChild = hwndTo;
-- 
1.5.4.5.GIT
