Commit 9da3b236 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

win32u: Move NtUserDragDetect() to window.c.

parent 64532621
...@@ -1394,51 +1394,6 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info ) ...@@ -1394,51 +1394,6 @@ BOOL WINAPI NtUserTrackMouseEvent( TRACKMOUSEEVENT *info )
return TRUE; 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 * set_capture_window
*/ */
......
...@@ -5541,6 +5541,51 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code ) ...@@ -5541,6 +5541,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.@) * NtUserDragObject (win32u.@)
*/ */
DWORD WINAPI NtUserDragObject( HWND parent, HWND hwnd, UINT fmt, ULONG_PTR data, HCURSOR cursor ) DWORD WINAPI NtUserDragObject( HWND parent, HWND hwnd, UINT fmt, ULONG_PTR data, HCURSOR cursor )
......
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