IDirectInput8::FindDevice

DirectX8

Microsoft DirectX 8.1 (C++)

IDirectInput8::FindDevice

Retrieves the instance GUID of a device that has been newly attached to the system. It is called in response to a Microsoft® 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. For more information, see the documentation on the DBT_DEVICEARRIVAL event in the Microsoft Platform Software Development Kit (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 IDirectInput8::CreateDevice.

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 Microsoft® DirectInput®. For example, they might refer to a storage device, rather than an input device.

Requirements

  Windows NT/2000/XP: Requires Windows® 2000.
  Windows 98/Me: Requires Windows 98 or later. Available as a redistributable for Windows 98.
  Header: Declared in Dinput.h.