Platform SDK: DirectX

DirectInput.GetDIEnumDevices

The DirectInput.GetDIEnumDevices method returns a DirectInputEnumDevices object which is used to enumerate devices that are either currently attached or could be attached to the computer.

object.GetDIEnumDevices( _ 
  deviceType As CONST_DIDEVICETYPE, _ 
  flags As CONST_DIENUMDEVICESFLAGS) _ 
  As DirectInputEnumDevices

Parameters

object
Object expression that resolves to a DirectInput object.
deviceType
Device type filter. If this parameter is 0, all device types are enumerated. Otherwise, it is one of the following DIDEVTYPE_* constants of the CONST_DIDEVICETYPE enumeration, indicating the device type that should be enumerated.
DIDEVTYPE_MOUSE
A mouse or mouse-like device (such as a trackball).
DIDEVTYPE_KEYBOARD
A keyboard or keyboard-like device.
DIDEVTYPE_JOYSTICK
A joystick or similar device, such as a steering wheel.
DIDEVTYPE_DEVICE
A device that does not fall into the previous categories.
flags
Flag value that specifies the scope of the enumeration. This parameter can be one of the following constants of the CONST_DIENUMDEVICESFLAGS enumeration. If this flag is 0 (DIEDFL_ALLDEVICES), then all installed devices are enumerated. If it is DIEDFL_ATTACHEDONLY, only devices actually attached to the system are enumerated.

Return Values

If the method succeeds, the method returns a DirectInputEnumDevices object.

Error Codes

If the method fails, an error is raised and Err.Number will be set.

Remarks

All installed devices can be enumerated, even if they are not present. For example, a joystick may be installed on the system but not currently plugged into the computer.

If a single piece of hardware can function as more than one DirectInput device type, it will be returned for each device type it supports. For example, a keyboard with a built-in mouse will be enumerated as a keyboard and as a mouse. The product GUID would be the same for each device, however.