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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function SetCapture (
hWnd As IntPtr
) As IntPtr
Dim hWnd As IntPtr
Dim returnValue As IntPtr
returnValue = User32.SetCapture(hWnd)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static IntPtr SetCapture(
IntPtr hWnd
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member SetCapture :
hWnd : IntPtr -> IntPtr
No code example is currently available or this language may not be supported.
- hWnd IntPtr
-
A handle to the window in the current thread that is to capture the mouse.
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
.