Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SetupDiGetSelectedDevice
Collapse the table of content
Expand the table of content

SetupDiGetSelectedDevice function

The SetupDiGetSelectedDevice function retrieves the selected device information element in a device information set.

Syntax


BOOL SetupDiGetSelectedDevice(
  _In_  HDEVINFO         DeviceInfoSet,
  _Out_ PSP_DEVINFO_DATA DeviceInfoData
);

Parameters

DeviceInfoSet [in]

A handle to the device information set for which to retrieve the selected device information element.

DeviceInfoData [out]

A pointer to an SP_DEVINFO_DATA structure that receives information about the selected device information element for DeviceInfoSet. The caller must set DeviceInfoData.cbSize to sizeof(SP_DEVINFO_DATA). If a device is currently not selected, the function fails and a call to GetLastError returns ERROR_NO_DEVICE_SELECTED.

Return value

The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.

Remarks

SetupDiGetSelectedDevice is usually used by an installation wizard.

Requirements

Target platform

Desktop

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

DLL

Setupapi.dll

See also

SetupDiSetSelectedDevice
SP_DEVINFO_DATA

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft