This function assigns the pointing device capture to hwnd.

With the pointing device capture set to a window, all pointing device input is directed to that window, regardless of whether the pointing device pointer is over that window.

When this function (hwndDesktop, NULLHANDLE) is called to release the pointing device capture, a WM_MOUSEMOVE message is posted regardless of whether the pointing device pointer has actually moved. This ensures that the window below the pointing device, at that time, is able to change features, such as the shape of the pointing device pointer.

If this function (hwndDesktop, HWND_THREADCAPTURE) is called, the pointing device is captured to the current thread. Pointing device QMSGs processed in this manner have NULLHANDLE window handles, and the pointing device coordinates are relative to the screen.

This function returns an unlocked window handle.

It must only be called while processing pointing device or keyboard input. A message box or dialog box must not be created while the pointing device is captured.


[Back] [Next]