Enumerates available devices.
HRESULT EnumDevices( DWORD dwDevType, LPDIENUMDEVICESCALLBACK lpCallback, LPVOID pvRef, DWORD dwFlags )
Device type filter.
To restrict the enumeration to a particular type of device, set this parameter to a DI8DEVTYPE_* value. See DIDEVICEINSTANCE.
To enumerate a class of devices, use one of the following values.
All devices that do not fall into another class.
All game controllers.
All keyboards. Equivalent to DI8DEVTYPE_KEYBOARD.
All devices of type DI8DEVTYPE_MOUSE and DI8DEVTYPE_SCREENPOINTER.
Address of a callback function to be called once for each device enumerated. See DIEnumDevicesCallback.
Application-defined 32-bit value to be passed to the enumeration callback each time it is called.
Flag value that specifies the scope of the enumeration. This parameter can be one or more of the following values:
All installed devices are enumerated. This is the default behavior.
Only attached and installed devices.
Only devices that support force feedback.
Include devices that are aliases for other devices.
Include hidden devices. For more information about hidden devices, see DIDEVCAPS.
Include phantom (placeholder) devices.
If the method succeeds, the return value is DI_OK. If the method fails, the return value can be one of the following error values: DIERR_INVALIDPARAM, DIERR_NOTINITIALIZED.
All installed devices can be enumerated, even if they are not present. For example, a flight stick might be installed on the system but not currently plugged into the computer. Set the dwFlags parameter to indicate whether only attached or all installed devices should be enumerated. If the DIEDFL_ATTACHEDONLY flag is not present, all installed devices are enumerated.
A preferred device type can be passed as a dwDevType filter so that only the devices of that type are enumerated.
On Microsoft Windows XP, DirectInput enumerates only one mouse and one keyboard device, referred to as the system mouse and the system keyboard. These devices represent the combined output of all mice and keyboards respectively on a system. For information about how to read from multiple mice or keyboards individually on Windows XP, see the WM_INPUT documentation.
The order in which devices are enumerated by DirectInput is not guaranteed.
Header: Declared in dinput.h.