GetThemeFont function (uxtheme.h)

Retrieves the value of a font property.


HRESULT GetThemeFont(
  [in]  HTHEME   hTheme,
  [in]  HDC      hdc,
  [in]  int      iPartId,
  [in]  int      iStateId,
  [in]  int      iPropId,
  [out] LOGFONTW *pFont


[in] hTheme


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

[in] hdc

Type: HDC

HDC. This parameter may be set to NULL.

[in] iPartId

Type: int

Value of type int that specifies the part that contains the font property. See Parts and States.

[in] iStateId

Type: int

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

[in] iPropId

Type: int

Value of type int that specifies the property to retrieve. For a list of possible values, see Property Identifiers.

[out] pFont


Pointer to a LOGFONT structure that receives the font property value.

Return value


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


The font is scaled in dots per inch (DPI) for the current logical screen.

If the property is not supported for the specified part and state, E_PROP_ID_UNSUPPORTED may be returned.


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

Property Identifiers