fixed NtUserGetClientOrigin()

svn path=/trunk/; revision=7204
This commit is contained in:
Thomas Bluemel 2003-12-23 21:33:25 +00:00
parent 3470b283b2
commit caedc5bf6b
3 changed files with 34 additions and 10 deletions

View file

@ -5,6 +5,8 @@
#define SWP_NOCLIENTMOVE 0x0800
#define SWP_NOCLIENTSIZE 0x1000
BOOL FASTCALL
IntGetClientOrigin(HWND hWnd, LPPOINT Point);
LRESULT FASTCALL
WinPosGetNonClientSize(HWND Wnd, RECT* WindowRect, RECT* ClientRect);
UINT FASTCALL

View file

@ -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: painting.c,v 1.51 2003/12/23 18:19:07 navaraf Exp $
* $Id: painting.c,v 1.52 2003/12/23 21:33:25 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -701,8 +701,8 @@ IntFixCaret(HWND hWnd, LPRECT lprc, UINT flags)
pt.x = info.rcCaret.left;
pt.y = info.rcCaret.top;
NtUserGetClientOrigin(info.hwndCaret, &FromOffset);
NtUserGetClientOrigin(hWnd, &ToOffset);
IntGetClientOrigin(info.hwndCaret, &FromOffset);
IntGetClientOrigin(hWnd, &ToOffset);
Offset.x = FromOffset.x - ToOffset.x;
Offset.y = FromOffset.y - ToOffset.y;
info.rcCaret.left += Offset.x;
@ -1153,7 +1153,7 @@ NtUserScrollWindowEx(HWND hWnd, INT dx, INT dy, const RECT *rect,
for (i = 0; List[i]; i++)
{
NtUserGetWindowRect(List[i], &r);
NtUserGetClientOrigin(hWnd, &ClientOrigin);
IntGetClientOrigin(hWnd, &ClientOrigin);
r.left -= ClientOrigin.x;
r.top -= ClientOrigin.y;
r.right -= ClientOrigin.x;

View file

@ -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: winpos.c,v 1.66 2003/12/23 21:13:00 weiden Exp $
/* $Id: winpos.c,v 1.67 2003/12/23 21:33:25 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -29,6 +29,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <internal/safe.h>
#include <win32k/win32k.h>
#include <include/object.h>
#include <include/guicheck.h>
@ -75,20 +76,41 @@
#define HAS_THINFRAME(Style, ExStyle) \
(((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
BOOL STDCALL
NtUserGetClientOrigin(HWND hWnd, LPPOINT Point)
BOOL FASTCALL
IntGetClientOrigin(HWND hWnd, LPPOINT Point)
{
PWINDOW_OBJECT WindowObject;
WindowObject = IntGetWindowObject(hWnd);
if (WindowObject == NULL)
{
Point->x = Point->y = 0;
return(TRUE);
return FALSE;
}
Point->x = WindowObject->ClientRect.left;
Point->y = WindowObject->ClientRect.top;
return(TRUE);
IntReleaseWindowObject(WindowObject);
return TRUE;
}
BOOL STDCALL
NtUserGetClientOrigin(HWND hWnd, LPPOINT Point)
{
BOOL Ret;
POINT pt;
NTSTATUS Status;
Ret = IntGetClientOrigin(hWnd, &pt);
Status = MmCopyToCaller(Point, &pt, sizeof(POINT));
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
return FALSE;
}
return Ret;
}
/*******************************************************************