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.dllCustom ImplementationNoHeaderuxtheme.hImport libraryUxTheme.libMinimum operating systems Windows XP
See Also
Property Identifiers