From 464468ce33d4a70c1365bdce98612848b2bbf031 Mon Sep 17 00:00:00 2001 From: Richard Campbell Date: Mon, 24 Mar 2003 23:08:51 +0000 Subject: [PATCH] Implemented UpdateWindow() svn path=/trunk/; revision=4427 --- reactos/iface/addsys/w32ksvc.db | 1 + reactos/include/win32k/ntuser.h | 3 ++ reactos/lib/user32/windows/paint.c | 4 +- reactos/subsys/win32k/ntuser/window.c | 56 +++++++++++---------------- 4 files changed, 28 insertions(+), 36 deletions(-) diff --git a/reactos/iface/addsys/w32ksvc.db b/reactos/iface/addsys/w32ksvc.db index 934e5cf05ba..b7ccd6139d9 100644 --- a/reactos/iface/addsys/w32ksvc.db +++ b/reactos/iface/addsys/w32ksvc.db @@ -529,6 +529,7 @@ NtUserUnregisterClass 3 NtUserUnregisterHotKey 2 NtUserUpdateInputContext 3 NtUserUpdateInstance 3 +NtUserUpdateWindow 1 NtUserUpdateLayeredWindow 9 NtUserUpdatePerUserSystemParameters 2 NtUserUserHandleGrantAccess 3 diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index 0f3ba01faf6..91cc51fafb9 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -1640,6 +1640,9 @@ NtUserUpdateInstance( DWORD Unknown1, DWORD Unknown2); +BOOL STDCALL +NtUserUpdateWindow( HWND hWnd ); + DWORD STDCALL NtUserUpdateLayeredWindow( diff --git a/reactos/lib/user32/windows/paint.c b/reactos/lib/user32/windows/paint.c index 924944c525d..23f894ca5bc 100644 --- a/reactos/lib/user32/windows/paint.c +++ b/reactos/lib/user32/windows/paint.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: paint.c,v 1.10 2003/03/18 09:16:44 gvg Exp $ +/* $Id: paint.c,v 1.11 2003/03/24 23:08:51 rcampbell Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -144,7 +144,7 @@ STDCALL UpdateWindow( HWND hWnd) { - return FALSE; + return NtUserUpdateWindow( hWnd ); } WINBOOL STDCALL diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index 2051588d399..c5d8a18f3d2 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.38 2003/03/24 01:36:10 rcampbell Exp $ +/* $Id: window.c,v 1.39 2003/03/24 23:08:51 rcampbell Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -851,41 +851,17 @@ NtUserMoveWindow( uExStyle = Window->ExStyle; pWinPos.hwnd = hWnd; - /* FIXME: Is this the correct behavior? */ - if (X) - { - pWinPos.x = X; - } - else - { - pWinPos.x = Window->WindowRect.left; - } - if (Y) - { - pWinPos.y = Y; - } - else - { - pWinPos.y = Window->WindowRect.top; - } - - if (nWidth) - { + pWinPos.x = X; + pWinPos.y = Y; + if (nWidth > NtUserGetSystemMetrics(SM_CXMIN)) pWinPos.cx = pWinPos.x + nWidth; - } else - { - pWinPos.cx = pWinPos.x + (Window->WindowRect.right - Window->WindowRect.left); - } - if (nHeight) - { - pWinPos.cy = pWinPos.y + nHeight; - } + pWinPos.cx = pWinPos.x + NtUserGetSystemMetrics(SM_CXMIN); + + if (nHeight > NtUserGetSystemMetrics(SM_CYMIN)) + pWinPos.cy = pWinPos.x + nHeight; else - { - pWinPos.cy = pWinPos.y + (Window->WindowRect.bottom - Window->WindowRect.top); - } - + pWinPos.cy = pWinPos.y + NtUserGetSystemMetrics(SM_CYMIN); NtUserSendMessage(hWnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)&pWinPos); Window->WindowRect.top = Window->ClientRect.top = pWinPos.y; @@ -901,7 +877,7 @@ NtUserMoveWindow( Window->ClientRect.right -= NtUserGetSystemMetrics(SM_CXSIZEFRAME); } if (uStyle & WS_CAPTION) - Window->ClientRect.top += NtUserGetSystemMetrics(SM_CYCAPTION) + 1; + Window->ClientRect.top += NtUserGetSystemMetrics(SM_CYCAPTION); if ( Window->Class->Class.lpszMenuName) { Window->ClientRect.top += NtUserGetSystemMetrics(SM_CYMENU); @@ -1175,6 +1151,18 @@ NtUserShowWindowAsync(DWORD Unknown0, return 0; } +BOOL STDCALL NtUserUpdateWindow( HWND hWnd ) +{ + PWINDOW_OBJECT pWindow = W32kGetWindowObject( hWnd); + + if (!pWindow) + return FALSE; + if (pWindow->UpdateRegion) + NtUserSendMessage( hWnd, WM_PAINT,0,0); + + return TRUE; +} + DWORD STDCALL NtUserUpdateLayeredWindow(DWORD Unknown0, DWORD Unknown1,