User32SetCapture Method

Sets the mouse capture to the specified window belonging to the current thread.

SetCapture(IntPtr) captures mouse input either when the mouse is over the capturing window, or when the mouse button was pressed while the mouse was over the capturing window and the button is still down.

Only one window at a time can capture the mouse.

If the mouse cursor is over a window created by another thread, the system will direct mouse input to the specified window only if a mouse button is down.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static IntPtr SetCapture(
	IntPtr hWnd
)

Parameters

hWnd  IntPtr
A handle to the window in the current thread that is to capture the mouse.

Return Value

IntPtr
The return value is a handle to the window that had previously captured the mouse.

If there is no such window, the return value is .

Remarks

See Also