SetupDiGetClassImageIndex function (setupapi.h)

The SetupDiGetClassImageIndex function retrieves the index within the class image list of a specified class.


WINSETUPAPI BOOL SetupDiGetClassImageIndex(
  [in]  PSP_CLASSIMAGELIST_DATA ClassImageListData,
  [in]  const GUID              *ClassGuid,
  [out] PINT                    ImageIndex


[in] ClassImageListData

A pointer to an SP_CLASSIMAGELIST_DATA structure that describes a class image list that includes the image for the device setup class that is specified by the ClassGuid parameter.

[in] ClassGuid

A pointer to the GUID of the device setup class for which to retrieve the index of the class image in the specified class image list.

[out] ImageIndex

A pointer to an INT-typed variable that receives the index of the specified class image in the class image list.

Return value

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


If the specified device setup class is not included in the specified class image list, SetupDiGetClassImageIndex returns the image index for the Unknown device setup class in the ImageIndex parameter.


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

See also