Export (0) Print
Expand All
Expand Minimize

GetThemeTextExtent function

Calculates the size and location of the specified text when rendered in the visual style font.

Syntax


HRESULT GetThemeTextExtent(
  _In_   HTHEME hTheme,
  _In_   HDC hdc,
  _In_   int iPartId,
  _In_   int iStateId,
  _In_   LPCWSTR pszText,
  _In_   int iCharCount,
  _In_   DWORD dwTextFlags,
  _In_   LPCRECT pBoundingRect,
  _Out_  LPRECT pExtentRect
);

Parameters

hTheme [in]

Type: HTHEME

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

hdc [in]

Type: HDC

HDC to select the font into.

iPartId [in]

Type: int

Value of type int that specifies the part in which the text will be drawn. See Parts and States.

iStateId [in]

Type: int

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

pszText [in]

Type: LPCWSTR

Pointer to a string that contains the text to draw.

iCharCount [in]

Type: int

Value of typeint that contains the number of characters to draw. If the parameter is set to -1, all the characters in the string are drawn.

dwTextFlags [in]

Type: DWORD

DWORD that contains one or more values that specify the string's formatting. See Format Values for possible parameter values.

pBoundingRect [in]

Type: LPCRECT

Pointer to a RECT structure that contains the rectangle used to control layout of the text. This parameter may be set to NULL.

pExtentRect [out]

Type: LPRECT

Pointer to a RECT structure that contains, in logical coordinates, the rectangle required to fit the rendered text.

Return value

Type: HRESULT

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

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Uxtheme.h

Library

UxTheme.lib

DLL

UxTheme.dll

See also

Property Identifiers

 

 

Community Additions

ADD
Show:
© 2014 Microsoft