Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Controls
Visual Styles
Functions
 GetThemeTextExtent Function

  Switch on low bandwidth view
GetThemeTextExtent Function

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

Syntax

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

Parameters

hTheme
[in] Handle to a window's specified theme data. Use OpenThemeData to create an HTHEME.
hdc
[in] Handle to a device context (HDC) to select the font into.
iPartId
[in] Value of type int that specifies the part in which the text will be drawn. See Parts and States.
iStateId
[in] Value of type int that specifies the state of the part. See Parts and States.
pszText
[in] Pointer to a string that contains the text to draw.
iCharCount
[in] 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] DWORD that contains one or more values that specify the string's formatting. See Format Values for possible parameter values.
pBoundingRect
[in] 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] Pointer to a RECT structure that contains, in logical coordinates, the rectangle required to fit the rendered text.

Return Value

Returns S_OK if successful, or an error value otherwise.

Function Information

Stock ImplementationUxTheme.dll
Custom ImplementationNo
Headeruxtheme.h
Import libraryUxTheme.lib
Minimum operating systems Windows XP

See Also

Property Identifiers
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker