From adcf4970da737f45ea743cc299441e16b2a64634 Mon Sep 17 00:00:00 2001 From: Richard Campbell Date: Wed, 12 Mar 2003 05:18:21 +0000 Subject: [PATCH] Implemented MoveWindow() svn path=/trunk/; revision=4288 --- reactos/subsys/win32k/ntuser/window.c | 41 ++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index 069680c1d69..8887f6ba067 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.27 2003/03/08 13:16:51 gvg Exp $ +/* $Id: window.c,v 1.28 2003/03/12 05:18:21 rcampbell Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -797,9 +797,42 @@ NtUserMoveWindow( int nHeight, BOOL bRepaint) { - int flags = SWP_NOZORDER | SWP_NOACTIVATE; - if (!bRepaint) flags |= SWP_NOREDRAW; - return NtUserSetWindowPos( hWnd, 0, X, Y, nWidth, nHeight, flags ); + PWINDOW_OBJECT Window; + NTSTATUS Status; + INT OffsetY, OffsetX; + Status = + ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable, + hWnd, + otWindow, + (PVOID*)&Window); + if (!NT_SUCCESS(Status)) + { + return(FALSE); + } + OffsetX = Window->ClientRect.left - Window->WindowRect.left; + OffsetY = Window->ClientRect.top - Window->WindowRect.top; + if (X) + { + Window->WindowRect.left = X; + Window->ClientRect.left = X; + } + if (Y) + { + Window->WindowRect.top = Y; + Window->ClientRect.top = Y; + } + if (nWidth) + { + Window->WindowRect.right = Window->WindowRect.left + nWidth; + Window->ClientRect.right = Window->ClientRect.left + nWidth - OffsetX - NtUserGetSystemMetrics(SM_CXFRAME); + } + if (nHeight) + { + Window->WindowRect.bottom = Window->WindowRect.top + nHeight; + Window->ClientRect.bottom = Window->ClientRect.top + nHeight - OffsetY - NtUserGetSystemMetrics(SM_CYFRAME); + } + ObmDereferenceObject(Window); + /* if (bRepaint) NtUserUpdateWindow(hWnd); doesn't exist? */ } DWORD STDCALL