mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 15:13:36 +00:00
Implementation of DragDetect. Based on Wine code (C) 1993, 1994 Alexandre Julliard.
svn path=/trunk/; revision=15831
This commit is contained in:
parent
4619446ed0
commit
cc0fc0d35c
1 changed files with 39 additions and 0 deletions
|
@ -44,7 +44,46 @@ DragDetect(
|
|||
HWND hWnd,
|
||||
POINT pt)
|
||||
{
|
||||
#if 0
|
||||
return NtUserDragDetect(hWnd, pt.x, pt.y);
|
||||
#else
|
||||
MSG msg;
|
||||
RECT rect;
|
||||
POINT tmp;
|
||||
ULONG dx = NtUserGetSystemMetrics(SM_CXDRAG);
|
||||
ULONG dy = NtUserGetSystemMetrics(SM_CYDRAG);
|
||||
|
||||
rect.left = pt.x - dx;
|
||||
rect.right = pt.x + dx;
|
||||
rect.top = pt.y - dy;
|
||||
rect.bottom = pt.y + dy;
|
||||
|
||||
SetCapture(hWnd);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
while (PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
|
||||
{
|
||||
if (msg.message == WM_LBUTTONUP)
|
||||
{
|
||||
ReleaseCapture();
|
||||
return 0;
|
||||
}
|
||||
if (msg.message == WM_MOUSEMOVE)
|
||||
{
|
||||
tmp.x = LOWORD(msg.lParam);
|
||||
tmp.y = HIWORD(msg.lParam);
|
||||
if (!PtInRect(&rect, tmp))
|
||||
{
|
||||
ReleaseCapture();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
WaitMessage();
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue