GetThemeBitmap function (uxtheme.h)

Retrieves the bitmap associated with a particular theme, part, state, and property.

Syntax

HRESULT GetThemeBitmap(
  [in]  HTHEME  hTheme,
  [in]  int     iPartId,
  [in]  int     iStateId,
  [in]  int     iPropId,
  [in]  ULONG   dwFlags,
  [out] HBITMAP *phBitmap
);

Parameters

[in] hTheme

Type: HTHEME

A handle to theme data.

[in] iPartId

Type: int

The part that contains the bitmap. See Parts and States.

[in] iStateId

Type: int

The state of the part.

[in] iPropId

Type: int

The property to retrieve. Pass zero to automatically select the first available bitmap for this part and state, or use one of the following values.

Value Meaning
TMT_DIBDATA
The background image.
TMT_GLYPHDIBDATA
The glyph image drawn on top of the background, if present.
TMT_HBITMAP
Not currently supported.

[in] dwFlags

Type: ULONG

The flags that specify how the bitmap is to be retrieved. Can be one of the following values.

Value Meaning
GBF_DIRECT
Retrieves a handle to the existing bitmap.
GBF_COPY
Retrieves a copy of the bitmap.
GBF_VALIDBITS
GBF_DIRECT | GBF_COPY

[out] phBitmap

Type: HBITMAP*

A pointer that receives a handle to the requested bitmap.

Return value

Type: HRESULT

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

Remarks

If dwFlags is set to GBF_COPY, release the bitmap stored in phBitmap when no longer needed by calling DeleteObject.

Requirements

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