WinAPI Reference
WinAPI Programmer's References
Win32
Win32 Multimedia
OLE
Pen API
Sockets 2
Telephony API (TAPI)

Websites for programmers
Delphi Tips&Tricks
Unix Manual Pages
MegaDetailed.Net

Software for programmers
Delphi components
.Net components

Follow us
LinkedIn Facebook Twitter Google+

Share this page
Free Components For Delphi and C++ Builder

Overview
Group
Quick Info

Windows NT
Yes
Win95
Yes
Win32s
No
Import Library
user32.lib
Header File
winuser.h
Unicode
No
Platform Notes
None

DragDetect

[Now Supported on Windows NT]

The DragDetect function captures the mouse and tracks its movement until the user releases the left button, presses the ESC key, or moves the mouse outside the "drag rectangle" around the specified point. The width and height of the drag rectangle are specified by the SM_CXDRAG and SM_CYDRAG values returned by the GetSystemMetrics function.

BOOL DragDetect(

HWND hwnd,

POINT pt

);

Parameters

hwnd

Handle to the window receiving mouse input.

pt

Initial position of the mouse, in screen coordinates. The function determines the coordinates of the drag rectangle by using this point.

Return Values

If the user moved the mouse outside of the drag rectangle while holding the left button down, the return value is nonzero.

If the user did not move the mouse outside of the drag rectangle while holding the left button down, the return value is zero.

Remarks

The system metrics for the drag rectangle are configurable, allowing for larger or smaller drag rectangles.

See Also

GetSystemMetrics


Programming books recommended by Amazon.com

More programming books on Amazon.com