win32u: Move NtUserDragDetect() to window.c.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2022-10-31 12:00:13 +03:00 committed by Alexandre Julliard
parent 645326214f
commit 9da3b23643
2 changed files with 45 additions and 45 deletions

View file

@ -1394,51 +1394,6 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info )
return TRUE;
}
/*******************************************************************
* NtUserDragDetect (win32u.@)
*/
BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y )
{
WORD width, height;
RECT rect;
MSG msg;
TRACE( "%p (%d,%d)\n", hwnd, x, y );
if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE;
width = get_system_metrics( SM_CXDRAG );
height = get_system_metrics( SM_CYDRAG );
SetRect( &rect, x - width, y - height, x + width, y + height );
NtUserSetCapture( hwnd );
for (;;)
{
while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ))
{
if (msg.message == WM_LBUTTONUP)
{
release_capture();
return FALSE;
}
if (msg.message == WM_MOUSEMOVE)
{
POINT tmp;
tmp.x = (short)LOWORD( msg.lParam );
tmp.y = (short)HIWORD( msg.lParam );
if (!PtInRect( &rect, tmp ))
{
release_capture();
return TRUE;
}
}
}
NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 );
}
return FALSE;
}
/**********************************************************************
* set_capture_window
*/

View file

@ -5540,6 +5540,51 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
}
}
/*******************************************************************
* NtUserDragDetect (win32u.@)
*/
BOOL WINAPI NtUserDragDetect( HWND hwnd, int x, int y )
{
WORD width, height;
RECT rect;
MSG msg;
TRACE( "%p (%d,%d)\n", hwnd, x, y );
if (!(NtUserGetKeyState( VK_LBUTTON ) & 0x8000)) return FALSE;
width = get_system_metrics( SM_CXDRAG );
height = get_system_metrics( SM_CYDRAG );
SetRect( &rect, x - width, y - height, x + width, y + height );
NtUserSetCapture( hwnd );
for (;;)
{
while (NtUserPeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ))
{
if (msg.message == WM_LBUTTONUP)
{
release_capture();
return FALSE;
}
if (msg.message == WM_MOUSEMOVE)
{
POINT tmp;
tmp.x = (short)LOWORD( msg.lParam );
tmp.y = (short)HIWORD( msg.lParam );
if (!PtInRect( &rect, tmp ))
{
release_capture();
return TRUE;
}
}
}
NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 );
}
return FALSE;
}
/*******************************************************************
* NtUserDragObject (win32u.@)
*/