mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
user32: Add some error checking in ScreenToClient and ClientToScreen.
This commit is contained in:
parent
5dea654317
commit
7fc61f6fea
@ -235,26 +235,6 @@ BOOL WINAPI GetClientRect( HWND hwnd, LPRECT rect )
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ClientToScreen (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt )
|
||||
{
|
||||
MapWindowPoints( hwnd, 0, lppnt, 1 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ScreenToClient (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI ScreenToClient( HWND hwnd, LPPOINT lppnt )
|
||||
{
|
||||
MapWindowPoints( 0, hwnd, lppnt, 1 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* list_children_from_point
|
||||
*
|
||||
@ -588,6 +568,48 @@ INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ClientToScreen (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt )
|
||||
{
|
||||
POINT offset;
|
||||
BOOL mirrored;
|
||||
|
||||
if (!hwnd)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
|
||||
return FALSE;
|
||||
}
|
||||
if (!WINPOS_GetWinOffset( hwnd, 0, &mirrored, &offset )) return FALSE;
|
||||
lppnt->x += offset.x;
|
||||
lppnt->y += offset.y;
|
||||
if (mirrored) lppnt->x = -lppnt->x;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ScreenToClient (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI ScreenToClient( HWND hwnd, LPPOINT lppnt )
|
||||
{
|
||||
POINT offset;
|
||||
BOOL mirrored;
|
||||
|
||||
if (!hwnd)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
|
||||
return FALSE;
|
||||
}
|
||||
if (!WINPOS_GetWinOffset( 0, hwnd, &mirrored, &offset )) return FALSE;
|
||||
lppnt->x += offset.x;
|
||||
lppnt->y += offset.y;
|
||||
if (mirrored) lppnt->x = -lppnt->x;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* IsIconic (USER32.@)
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user