HWND SetCapture(hwnd) | |||||
HWND hwnd; | /* handle of window to receive mouse capture | */ |
The SetCapture function sets the mouse capture to the specified window belonging to the current thread. With the mouse capture set to a window, all mouse input is directed to that window, regardless of whether the mouse cursor is over that window. Only one window at a time can have the mouse capture.
If the mouse 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.
hwnd
Identifies the window in the current thread that is to receive the mouse capture.
The return value is the handle of the window that previously had the mouse capture, if the function is successful. It is NULL if there is no such window.
When the window no longer requires all mouse input, the application should call the ReleaseCapture function so that other windows can receive mouse input.
This function cannot be used to capture mouse input meant for another process.
GetCapture, ReleaseCapture