Skip to content

Latest commit

 

History

History
151 lines (123 loc) · 3.41 KB

nf-joystickapi-joysetcapture.md

File metadata and controls

151 lines (123 loc) · 3.41 KB
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.
_win32_joySetCapture
joySetCapture
joySetCapture function [Windows Multimedia]
joystickapi/joySetCapture
multimedia.joysetcapture
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
joySetCapture
joystickapi/joySetCapture
c++
APIRef
kbSyntax
DllExport
Winmm.dll
API-MS-Win-mm-joystick-l1-1-0.dll
winmmbase.dll
joySetCapture

joySetCapture function

-description

The joySetCapture function captures a joystick by causing its messages to be sent to the specified window.

-parameters

-param hwnd

Handle to the window to receive the joystick messages.

-param uJoyID

Identifier of the joystick to be captured. Valid values for uJoyID range from zero (JOYSTICKID1) to 15.

-param uPeriod

Polling frequency, in milliseconds.

-param fChanged

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

Returns JOYERR_NOERROR if successful or one of the following error values.

Return code Description
MMSYSERR_NODRIVER
The joystick driver is not present.
MMSYSERR_INVALPARAM
Invalid joystick ID or hwnd is NULL.
JOYERR_NOCANDO
Cannot capture joystick input because a required service (such as a Windows timer) is unavailable.
JOYERR_UNPLUGGED
The specified joystick is not connected to the system.
JOYERR_PARMS
Invalid joystick ID or hwnd is NULL.

-remarks

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.

-see-also

Joysticks

Multimedia Joystick Functions