SetupDiSetSelectedDevice function

The SetupDiSetSelectedDevice function sets a device information element as the selected member of a device information set. This function is typically used by an installation wizard.

Syntax

WINSETUPAPI BOOL SetupDiSetSelectedDevice(
  HDEVINFO         DeviceInfoSet,
  PSP_DEVINFO_DATA DeviceInfoData
);

Parameters

DeviceInfoSet

A handle to the device information set that contains the device information element to set as the selected member of the device information set.

DeviceInfoData

A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet to set as the selected member of DeviceInfoSet.

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.

Requirements

   
Windows version 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

See Also

SetupDiGetSelectedDevice