DrawThemeIcon function

Draws an image from an image list with the icon effect defined by the visual style.

Syntax

THEMEAPI DrawThemeIcon(
  HTHEME     hTheme,
  HDC        hdc,
  int        iPartId,
  int        iStateId,
  LPCRECT    pRect,
  HIMAGELIST himl,
  int        iImageIndex
);

Parameters

hTheme

Type: HTHEME

Handle to a window's specified theme data. Use OpenThemeData to create an HTHEME.

hdc

Type: HDC

HDC.

iPartId

Type: int

Value of type int that specifies the part in which the image is drawn. See Parts and States.

iStateId

Type: int

Value of type int that specifies the state of the part. See Parts and States.

pRect

Type: LPCRECT

Pointer to a RECT structure that contains, in logical coordinates, the rectangle in which the image is drawn.

himl

Type: HIMAGELIST

Handle to an image list that contains the image to draw.

iImageIndex

Type: int

Value of type int that specifies the index of the image to draw.

Return Value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header uxtheme.h
Library UxTheme.lib
DLL UxTheme.dll

See Also

IImageList

Property Identifiers

Reference