mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:33:01 +00:00
- Pass correct coordinates in WM_MOVE
- Fix non-client size calculation svn path=/trunk/; revision=6215
This commit is contained in:
parent
340061ddcf
commit
54c0f5b8de
1 changed files with 26 additions and 17 deletions
|
@ -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,23 +1725,33 @@ 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));
|
|
||||||
|
|
||||||
if (!(Pos->flags & SWP_NOCLIENTSIZE))
|
|
||||||
{
|
{
|
||||||
WPARAM wp = SIZE_RESTORED;
|
SendMessageW(hWnd, WM_MOVE, 0, MAKELONG(Rect.left, Rect.top));
|
||||||
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;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue