- Pass correct coordinates in WM_MOVE

- Fix non-client size calculation

svn path=/trunk/; revision=6215
This commit is contained in:
Gé van Geldorp 2003-10-03 11:44:44 +00:00
parent 340061ddcf
commit 54c0f5b8de

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -1623,12 +1623,11 @@ DefWndAdjustRect(RECT* Rect, ULONG Style, BOOL Menu, ULONG ExStyle)
} }
if (Style & WS_CAPTION) if (Style & WS_CAPTION)
{ {
Rect->top -= (GetSystemMetrics(SM_CYCAPTION) - Rect->top -= GetSystemMetrics(SM_CYCAPTION);
GetSystemMetrics(SM_CYBORDER)) + 1;
} }
if (Menu) 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)) if (UserHasMenu(hWnd, Style))
{ {
Rect->top += MenuGetMenuBarHeight(hWnd, Rect->right - Rect->left, Rect->top += MenuGetMenuBarHeight(hWnd, Rect->right - Rect->left,
-TmpRect.left, -TmpRect.top) + 1; -TmpRect.left, -TmpRect.top);
} }
if (Rect->top > Rect->bottom) if (Rect->top > Rect->bottom)
Rect->bottom = Rect->top; Rect->bottom = Rect->top;
@ -1726,20 +1725,30 @@ DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos)
LRESULT LRESULT
DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos) 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)) if (! (Pos->flags & SWP_NOCLIENTMOVE))
SendMessageW(hWnd, WM_MOVE, 0, MAKELONG(rect.left, rect.top)); {
SendMessageW(hWnd, WM_MOVE, 0, MAKELONG(Rect.left, Rect.top));
}
if (!(Pos->flags & SWP_NOCLIENTSIZE)) if (! (Pos->flags & SWP_NOCLIENTSIZE))
{ {
WPARAM wp = SIZE_RESTORED; WPARAM wp = SIZE_RESTORED;
if (IsZoomed(hWnd)) wp = SIZE_MAXIMIZED; if (IsZoomed(hWnd))
else if (IsIconic(hWnd)) wp = SIZE_MINIMIZED; {
wp = SIZE_MAXIMIZED;
}
else if (IsIconic(hWnd))
{
wp = SIZE_MINIMIZED;
}
SendMessageW(hWnd, WM_SIZE, wp, SendMessageW(hWnd, WM_SIZE, wp,
MAKELONG(rect.right - rect.left, rect.bottom - rect.top)); MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top));
} }
return 0; return 0;