GetThemeTextMetrics function (uxtheme.h)

Retrieves information about the font specified by a visual style for a particular part.

Syntax

HRESULT GetThemeTextMetrics(
  [in]  HTHEME      hTheme,
  [in]  HDC         hdc,
  [in]  int         iPartId,
  [in]  int         iStateId,
  [out] TEXTMETRICW *ptm
);

Parameters

[in] hTheme

Type: HTHEME

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

[in] hdc

Type: HDC

HDC to use for screen context. This parameter may be set to NULL.

[in] iPartId

Type: int

Value of type int that specifies the part to retrieve font information about. See Parts and States.

[in] iStateId

Type: int

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

[out] ptm

Type: TEXTMETRIC*

Receives the font information.

Return value

Type: HRESULT

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

Requirements

Requirement Value
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