From 63d294b58a9d41b655eb7b01fc1d532d6467f296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Thu, 6 Mar 2003 21:03:49 +0000 Subject: [PATCH] GetClientRect implementation by Tim Jobling svn path=/trunk/; revision=4251 --- reactos/iface/addsys/w32ksvc.db | 1 + reactos/include/win32k/ntuser.h | 2 ++ reactos/lib/user32/windows/window.c | 4 ++-- reactos/subsys/win32k/ntuser/window.c | 24 +++++++++++++++++++++++- 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/reactos/iface/addsys/w32ksvc.db b/reactos/iface/addsys/w32ksvc.db index b1190ea2ecf..934e5cf05ba 100644 --- a/reactos/iface/addsys/w32ksvc.db +++ b/reactos/iface/addsys/w32ksvc.db @@ -359,6 +359,7 @@ NtUserGetClassInfo 5 NtUserGetClassLong 2 NtUserGetClassName 3 NtUserGetClientOrigin 2 +NtUserGetClientRect 2 NtUserGetClipboardData 2 NtUserGetClipboardFormatName 3 NtUserGetClipboardOwner 0 diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index d841c834978..f191c38dbc5 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -11,6 +11,8 @@ INT STDCALL NtUserReleaseDC(HWND hWnd, HDC hDc); BOOL STDCALL NtUserGetWindowRect(HWND hWnd, LPRECT Rect); +BOOL STDCALL +NtUserGetClientRect(HWND hWnd, LPRECT Rect); HANDLE STDCALL NtUserGetProp(HWND hWnd, ATOM Atom); BOOL STDCALL diff --git a/reactos/lib/user32/windows/window.c b/reactos/lib/user32/windows/window.c index 95827a449be..7b6180c1388 100644 --- a/reactos/lib/user32/windows/window.c +++ b/reactos/lib/user32/windows/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.17 2003/03/04 22:34:48 rcampbell Exp $ +/* $Id: window.c,v 1.18 2003/03/06 21:03:49 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS user32.dll @@ -577,7 +577,7 @@ GetAncestor(HWND hwnd, UINT gaFlags) WINBOOL STDCALL GetClientRect(HWND hWnd, LPRECT lpRect) { - return FALSE; + return(NtUserGetClientRect(hWnd, lpRect)); } HWND STDCALL diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index 8d15fc24d4f..04b300226ae 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.23 2003/03/04 00:39:56 rcampbell Exp $ +/* $Id: window.c,v 1.24 2003/03/06 21:03:49 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -11,6 +11,7 @@ /* INCLUDES ******************************************************************/ #include +#include #include #include #include @@ -189,6 +190,27 @@ NtUserGetWindowRect(HWND hWnd, LPRECT Rect) return(W32kGetWindowRect(hWnd, Rect)); } +BOOL STDCALL +NtUserGetClientRect(HWND hWnd, LPRECT Rect) +{ + PWINDOW_OBJECT WindowObject; + RECT SafeRect; + + WindowObject = W32kGetWindowObject(hWnd); + if (WindowObject == NULL) + { + return(FALSE); + } + W32kGetClientRect(WindowObject, &SafeRect); + if (! NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT)))) + { + return(FALSE); + } + + W32kReleaseWindowObject(WindowObject); + return(TRUE); +} + HWND W32kGetActiveWindow(VOID) {