joyGetDevCapsA function (joystickapi.h)

The joyGetDevCaps function queries a joystick to determine its capabilities.

Syntax

MMRESULT joyGetDevCapsA(
  UINT_PTR   uJoyID,
  LPJOYCAPSA pjc,
  UINT       cbjc
);

Parameters

uJoyID

Identifier of the joystick to be queried. Valid values for uJoyID range from -1 to 15. A value of -1 enables retrieval of the szRegKey member of the JOYCAPS structure whether a device is present or not.

pjc

Pointer to a JOYCAPS structure to contain the capabilities of the joystick.

cbjc

Size, in bytes, of the JOYCAPS structure.

Return value

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

Return code Description
MMSYSERR_NODRIVER
The joystick driver is not present, or the specified joystick identifier is invalid. The specified joystick identifier is invalid.
MMSYSERR_INVALPARAM
An invalid parameter was passed.

Remarks

Use the joyGetNumDevs function to determine the number of joystick devices supported by the driver.

This method fails when passed an invalid value for the cbjc parameter.

Note

The joystickapi.h header defines joyGetDevCaps as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header joystickapi.h (include Windows.h)
Library Winmm.lib
DLL Winmm.dll

See also

Joysticks
Multimedia Joystick Functions