Microsoft DirectX 9.0

IDirectInputDevice8::EnumObjects Method

Enumerates the input and output objects available on a device.


HRESULT EnumObjects(      



Address of a callback function that receives DirectInputDevice objects. Microsoft?DirectInput?provides a prototype of this function as DIEnumDeviceObjectsCallback.
Reference data (context) for callback.
Flags that specify the types of object to be enumerated. Each of the following values restricts the enumeration to objects of the described type:
An absolute axis.
Controls identified by a Human Interface Device (HID) usage alias. This flag applies only to HID-compliant USB devices.
All objects.
An axis, either absolute or relative.
A push button or a toggle button.
A HID link collection. HID link collections do not generate data of their own.
An object that belongs to HID link collection number n.
An object that contains a force-feedback actuator. In other words, forces can be applied to this object.
An object that can be used to trigger force-feedback effects.
An object that does not belong to any HID link collection; in other words, an object for which the wCollectionNumber member of the DIDEVICEOBJECTINSTANCE structure is 0.
An object that does not generate data.
An object that supports output. For details, see Remarks in IDirectInputDevice8::SendDeviceData.
A point-of-view controller.
A push button. A push button is reported as down when the user presses it, and as up when the user releases it.
A relative axis.
A toggle button. A toggle button is reported as down when the user presses it and remains so until the user presses the button a second time.
An object of a type defined by the manufacturer.

Return Value

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_INVALIDPARAMAn invalid parameter was passed to the returning function, or the object was not in a state that permitted the function to be called. This value is equal to the E_INVALIDARG standard Component Object Model (COM) return value.
DIERR_NOTINITIALIZEDThe object has not been initialized.


The DIDFT_FFACTUATOR and DIDFT_FFEFFECTTRIGGER flags in the dwFlags parameter restrict enumeration to objects that meet all the criteria defined by the included flags. For all the other flags, an object is enumerated if it meets the criterion defined by any included flag in this category. For example, (DIDFT_FFACTUATOR | DIDFT_FFEFFECTTRIGGER) restricts enumeration to force-feedback trigger objects, and (DIDFT_FFEFFECTTRIGGER | DIDFT_TGLBUTTON | DIDFT_PSHBUTTON) restricts enumeration to buttons of any kind that can be used as effect triggers.

Applications should not rely on this method to determine whether certain keyboard keys or indicator lights are present, as these objects might be enumerated even though they are not present. Although the basic set of available objects can be determined from the device subtype, there is no reliable way of determining whether extra objects such as the menu key are available.

© 2002 Microsoft Corporation. All rights reserved.