Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The SetupDiGetSelectedDevice function retrieves the selected device information element in a device information set.
WINSETUPAPI BOOL SetupDiGetSelectedDevice(
[in] HDEVINFO DeviceInfoSet,
[out] PSP_DEVINFO_DATA DeviceInfoData
);
[in] DeviceInfoSet
A handle to the device information set for which to retrieve the selected device information element.
[out] DeviceInfoData
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.
The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.
SetupDiGetSelectedDevice is usually used by an installation wizard.
Requirement | Value |
---|---|
Minimum supported client | Available in Microsoft Windows 2000 and later versions of Windows. |
Target Platform | Desktop |
Header | setupapi.h (include Setupapi.h) |
Library | Setupapi.lib |
DLL | Setupapi.dll |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today