Commit b133b756 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move ScreenToClient implementation from user32.

parent 0cfc7c44
......@@ -432,21 +432,9 @@ BOOL WINAPI ClientToScreen( HWND hwnd, LPPOINT lppnt )
/*******************************************************************
* ScreenToClient (USER32.@)
*/
BOOL WINAPI ScreenToClient( HWND hwnd, LPPOINT lppnt )
BOOL WINAPI ScreenToClient( HWND hwnd, POINT *pt )
{
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;
return NtUserCallHwndParam( hwnd, (UINT_PTR)pt, NtUserScreenToClient );
}
......
......@@ -2587,6 +2587,24 @@ other_process: /* one of the parents may belong to another process, do it the h
return ret;
}
/* see ScreenToClient */
static BOOL screen_to_client( HWND hwnd, POINT *pt )
{
POINT offset;
BOOL mirrored;
if (!hwnd)
{
SetLastError( ERROR_INVALID_WINDOW_HANDLE );
return FALSE;
}
if (!get_windows_offset( 0, hwnd, get_thread_dpi(), &mirrored, &offset )) return FALSE;
pt->x += offset.x;
pt->y += offset.y;
if (mirrored) pt->x = -pt->x;
return TRUE;
}
/* map coordinates of a window region */
void map_window_region( HWND from, HWND to, HRGN hrgn )
{
......@@ -5019,6 +5037,8 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
return kill_system_timer( hwnd, param );
case NtUserMonitorFromWindow:
return HandleToUlong( monitor_from_window( hwnd, param, NtUserMonitorFromWindow ));
case NtUserScreenToClient:
return screen_to_client( hwnd, (POINT *)param );
case NtUserSetCaptureWindow:
return set_capture_window( hwnd, param, NULL );
case NtUserSetForegroundWindow:
......
......@@ -212,6 +212,7 @@ enum
NtUserIsChild,
NtUserKillSystemTimer,
NtUserMonitorFromWindow,
NtUserScreenToClient,
NtUserSetCaptureWindow,
NtUserSetForegroundWindow,
NtUserSetWindowPixelFormat,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment