From 54c0f5b8de76d2cf0ce4d6cc8032062e2542f890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Fri, 3 Oct 2003 11:44:44 +0000 Subject: [PATCH] - Pass correct coordinates in WM_MOVE - Fix non-client size calculation svn path=/trunk/; revision=6215 --- reactos/lib/user32/windows/defwnd.c | 43 +++++++++++++++++------------ 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/reactos/lib/user32/windows/defwnd.c b/reactos/lib/user32/windows/defwnd.c index 05bd2c4cde5..e790d7da77d 100644 --- a/reactos/lib/user32/windows/defwnd.c +++ b/reactos/lib/user32/windows/defwnd.c @@ -1,4 +1,4 @@ -/* $Id: defwnd.c,v 1.91 2003/10/01 19:11:06 weiden Exp $ +/* $Id: defwnd.c,v 1.92 2003/10/03 11:44:44 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -1623,12 +1623,11 @@ DefWndAdjustRect(RECT* Rect, ULONG Style, BOOL Menu, ULONG ExStyle) } if (Style & WS_CAPTION) { - Rect->top -= (GetSystemMetrics(SM_CYCAPTION) - - GetSystemMetrics(SM_CYBORDER)) + 1; + Rect->top -= GetSystemMetrics(SM_CYCAPTION); } if (Menu) { - Rect->top -= GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CYBORDER); + Rect->top -= GetSystemMetrics(SM_CYMENU); } } @@ -1687,7 +1686,7 @@ DefWndNCCalcSize(HWND hWnd, RECT* Rect) if (UserHasMenu(hWnd, Style)) { Rect->top += MenuGetMenuBarHeight(hWnd, Rect->right - Rect->left, - -TmpRect.left, -TmpRect.top) + 1; + -TmpRect.left, -TmpRect.top); } if (Rect->top > Rect->bottom) Rect->bottom = Rect->top; @@ -1726,23 +1725,33 @@ DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos) LRESULT DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos) { - RECT rect; + RECT Rect; - GetClientRect(hWnd, &rect); + GetClientRect(hWnd, &Rect); + MapWindowPoints(hWnd, (GetWindowLongW(hWnd, GWL_STYLE) & WS_CHILD ? + GetParent(hWnd) : NULL), (LPPOINT) &Rect, 2); - if (!(Pos->flags & SWP_NOCLIENTMOVE)) - SendMessageW(hWnd, WM_MOVE, 0, MAKELONG(rect.left, rect.top)); - - if (!(Pos->flags & SWP_NOCLIENTSIZE)) + if (! (Pos->flags & SWP_NOCLIENTMOVE)) { - WPARAM wp = SIZE_RESTORED; - if (IsZoomed(hWnd)) wp = SIZE_MAXIMIZED; - else if (IsIconic(hWnd)) wp = SIZE_MINIMIZED; - SendMessageW(hWnd, WM_SIZE, wp, - MAKELONG(rect.right - rect.left, rect.bottom - rect.top)); + SendMessageW(hWnd, WM_MOVE, 0, MAKELONG(Rect.left, Rect.top)); } - return 0; + if (! (Pos->flags & SWP_NOCLIENTSIZE)) + { + WPARAM wp = SIZE_RESTORED; + if (IsZoomed(hWnd)) + { + wp = SIZE_MAXIMIZED; + } + else if (IsIconic(hWnd)) + { + wp = SIZE_MINIMIZED; + } + SendMessageW(hWnd, WM_SIZE, wp, + MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top)); + } + + return 0; } /***********************************************************************