Returning the Number of Devices

MMSYSTEM sends a JDD_GETNUMDEVS message to a joystick driver to determine how many devices it supports. The lParam1 and lParm2 parameters are not used with this message. In response to the JDD_GETNUMDEVS message, the driver returns the maximum number of devices it supports.

The number of supported devices returned by a driver is not necessarily the same as the number of connected devices. This lets a user connect a device after the driver has been loaded. The joystick interface provides a JOYERR_UNPLUGGED error value that a driver should return when an application polls an unplugged device. For example, the IBMJOY.DRV driver returns 2 in response to this message, regardless of the number of joysticks actually connected to the adapter.