Allocate space for menu in MoveWindow, will filter this change to SetWindowPos/CreateWindowEx soon, gotta go. PS doesn't work yet due to menu not being 'seen'

svn path=/trunk/; revision=4390
This commit is contained in:
Richard Campbell 2003-03-22 03:05:26 +00:00
parent 7c39153727
commit 948bca0d7e

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.35 2003/03/20 10:09:24 gvg Exp $ /* $Id: window.c,v 1.36 2003/03/22 03:05:26 rcampbell Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -840,43 +840,39 @@ NtUserMoveWindow(
int nHeight, int nHeight,
BOOL bRepaint) BOOL bRepaint)
{ {
PWINDOW_OBJECT Window; PWINDOW_OBJECT Window = W32kGetWindowObject(hWnd);
NTSTATUS Status; ULONG uStyle, uExStyle;
INT OffsetY, OffsetX; if (!Window)
Status =
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
hWnd,
otWindow,
(PVOID*)&Window);
if (!NT_SUCCESS(Status))
{ {
return(FALSE); return FALSE;
} }
OffsetX = Window->ClientRect.left - Window->WindowRect.left; uStyle = Window->Style;
OffsetY = Window->ClientRect.top - Window->WindowRect.top; uExStyle = Window->ExStyle;
if (X) if (X)
{
Window->WindowRect.left = X; Window->WindowRect.left = X;
Window->ClientRect.left = X;
}
if (Y) if (Y)
{
Window->WindowRect.top = Y; Window->WindowRect.top = Y;
Window->ClientRect.top = Y;
}
if (nWidth) if (nWidth)
{
Window->WindowRect.right = Window->WindowRect.left + nWidth; Window->WindowRect.right = Window->WindowRect.left + nWidth;
Window->ClientRect.right = Window->ClientRect.left + nWidth - OffsetX - NtUserGetSystemMetrics(SM_CXFRAME);
}
if (nHeight) if (nHeight)
{
Window->WindowRect.bottom = Window->WindowRect.top + nHeight; Window->WindowRect.bottom = Window->WindowRect.top + nHeight;
Window->ClientRect.bottom = Window->ClientRect.top + nHeight - OffsetY - NtUserGetSystemMetrics(SM_CYFRAME); Window->ClientRect = Window->WindowRect;
if (uStyle & WS_BORDER)
{
Window->ClientRect.top += NtUserGetSystemMetrics(SM_CYSIZEFRAME);
Window->ClientRect.bottom -= NtUserGetSystemMetrics(SM_CYSIZEFRAME);
Window->ClientRect.left += NtUserGetSystemMetrics(SM_CXSIZEFRAME);
Window->ClientRect.right -= NtUserGetSystemMetrics(SM_CXSIZEFRAME);
} }
ObmDereferenceObject(Window); if (uStyle & WS_CAPTION)
/* if (bRepaint) NtUserUpdateWindow(hWnd); doesn't exist? */ Window->ClientRect.top += NtUserGetSystemMetrics(SM_CYCAPTION);
return(TRUE); if (Window->Menu)
{
Window->ClientRect.top += NtUserGetSystemMetrics(SM_CYMENU);
}
W32kReleaseWindowObject(Window);
return TRUE;
} }
DWORD STDCALL DWORD STDCALL