Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function sets the pen capture to the specified window belonging to the current thread. After a window has captured the pen, all pen input is directed to that window. Only one window at a time can capture the pen.
HWND SetCapture( HWND hWnd );
Parameters
Return Values
The handle of the window that had previously captured the mouse indicates success. NULL indicates that there is no such window.
Remarks
Only the foreground window can capture the mouse. When a background window attempts to do so, the window receives messages only for mouse events that occur when the cursor hot spot is within the visible portion of the window. Also, even if the foreground window has captured the mouse, the user can still click another window, bringing it to the foreground.
When the window no longer requires all mouse input, the thread that created the window should call the ReleaseCapturefunction to release the mouse.
This function cannot be used to capture mouse input meant for another process.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winuser.h | Foregnd.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
GetCapture, ReleaseCapture, WM_CAPTURECHANGED