Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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(
[in] HWND hwnd,
[in] POINT pt
);
[in] hwnd
Type: HWND
A handle to the window receiving mouse input.
[in] pt
Type: POINT
Initial position of the mouse, in screen coordinates. The function determines the coordinates of the drag rectangle by using this point.
Type: BOOL
If the user moved the mouse outside of the drag rectangle while holding down the left button, the return value is nonzero.
If the user did not move the mouse outside of the drag rectangle while holding down the left button, the return value is zero.
The system metrics for the drag rectangle are configurable, allowing for larger or smaller drag rectangles.
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | winuser.h (include Windows.h) |
Library | User32.lib |
DLL | User32.dll |
Conceptual
Reference
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today