UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:joystickapi.joySetCapture |
joySetCapture function (joystickapi.h) |
The joySetCapture function captures a joystick by causing its messages to be sent to the specified window. |
|
multimedia\joysetcapture.htm |
Multimedia |
d4511c2c-54b3-48f5-aa30-e198292a4728 |
12/05/2018 |
_win32_joySetCapture, joySetCapture, joySetCapture function [Windows Multimedia], joystickapi/joySetCapture, multimedia.joysetcapture |
joystickapi.h |
Windows.h |
Windows |
Windows 2000 Professional [desktop apps only] |
Windows 2000 Server [desktop apps only] |
Winmm.lib |
Winmm.dll |
Windows |
19H1 |
|
|
|
|
|
|
The joySetCapture function captures a joystick by causing its messages to be sent to the specified window.
Handle to the window to receive the joystick messages.
Identifier of the joystick to be captured. Valid values for uJoyID range from zero (JOYSTICKID1) to 15.
Polling frequency, in milliseconds.
Change position flag. Specify TRUE for this parameter to send messages only when the position changes by a value greater than the joystick movement threshold. Otherwise, messages are sent at the polling frequency specified in uPeriod.
Returns JOYERR_NOERROR if successful or one of the following error values.
Return code | Description |
---|---|
|
The joystick driver is not present. |
|
Invalid joystick ID or hwnd is NULL. |
|
Cannot capture joystick input because a required service (such as a Windows timer) is unavailable. |
|
The specified joystick is not connected to the system. |
|
Invalid joystick ID or hwnd is NULL. |
If the specified joystick is currently captured, the function returns undefined behavior. Call the joyReleaseCapture function to release the captured joystick, or destroy the window to release the joystick automatically.