joyGetDevCaps

The joyGetDevCaps function queries a joystick to determine its capabilities.

MMRESULT joyGetDevCaps(
  UINT_PTR  uJoyID, 
  LPJOYCAPS 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. For Windows NT 4.0, valid values are limited to zero (JOYSTICKID1) and JOYSTICKID2.

pjc

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

cbjc

Size, in bytes, of the JOYCAPS structure.

Return Values

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

Value Description
MMSYSERR_NODRIVER The joystick driver is not present.
Windows NT/2000/XP: The specified joystick identifier is invalid.
MMSYSERR_INVALPARAM An invalid parameter was passed.
Windows 95/98/Me: The specified joystick identifier is invalid.

Remarks

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

Windows NT/2000/XP: This method fails when passed an invalid value for the cbjc parameter.
Windows 95/98/Me: This method succeeds when passed an invalid value for the cbjc parameter.

Requirements

  Windows NT/2000/XP: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Mmsystem.h; include Windows.h.
  Library: Use Winmm.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.

See Also

Joysticks, Multimedia Joystick Functions, JOYCAPS, joyGetNumDevs

Show: