Platform SDK: DirectX

IDirectInput7::FindDevice

The IDirectInput7::FindDeviceStatus method retrieves the instance GUID of a device that has been newly attached to the system. It is called in response to a Win32 device management notification.

HRESULT FindDevice(
  REFGUID rguidClass, 
  LPCTSTR ptszName, 
  LPGUID pguidInstance
);

Parameters

rguidClass
Unique identifier of the device class for the device that the application is to locate. The application obtains the class GUID from the device arrival notification. (See the documentation for the DBT_DEVICEARRIVAL event in the Platform SDK.)
ptszName
Name of the device. The application obtains the name from the device arrival notification.
pguidInstance
Address of a variable to receive the instance GUID for the device, if the device is found. This value can be passed to IDirectInput7::CreateDeviceEx.

Return Values

If the method succeeds, the return value is DI_OK.

If the method fails, the return value can be DIERR_DEVICENOTREG. Failure results if the GUID and name do not correspond to a device class that is registered with DirectInput. For example, they might refer to a storage device, rather than an input device.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dinput.h.
  Import Library: Use dinput.lib.

See Also

Recognizing Device Changes