DrawThemeTextEx Function

Draws text using the color and font defined by the visual style. Extends DrawThemeText by allowing additional text format options.

Syntax

HRESULT DrawThemeTextEx(      
    HTHEME hTheme,     HDC hdc,     int iPartId,     int iStateId,     LPCWSTR pszText,     int iCharCount,     DWORD dwFlags,     LPRECT pRect,     const DTTOPTS *pOptions );

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 use for drawing.
iPartId
[in] The control part that has the desired text appearance. See Parts and States. If this value is 0, the text is drawn in the default font, or a font selected into the device context.
iStateId
[in] The control state that has the desired text appearance. See Parts and States.
pszText
[in] Pointer to a string that contains the text to draw.
iCharCount
[in] Value of type int that contains the number of characters to draw. If the parameter is set to -1, all the characters in the string are drawn.
dwFlags
[in] DWORD that contains one or more values that specify the string's formatting. See Format Values for possible parameter values.
pRect
[in, out] Pointer to a >RECT structure that contains the rectangle, in logical coordinates, in which the text is to be drawn.
pOptions
[in] A DTTOPTS structure that defines additional formatting options that will be applied to the text being drawn.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The function always uses the themed font for the specified part and state if one is defined. Otherwise it uses the font currently selected into the device context. To find out if a themed font is defined, you can call GetThemeFont or GetThemePropertyOrigin with TMT_FONT as the property identifier.

Function Information

Stock ImplementationUxTheme.dll
Custom ImplementationNo
Headeruxtheme.h
Import libraryUxTheme.lib
Minimum operating systems Windows Vista
Tags :


Page view tracker