This topic has not yet been rated - Rate this topic

DrawThemeTextEx function

Applies to: desktop apps only

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

Syntax

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

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 use for drawing.

iPartId [in]

Type: int

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]

Type: int

The control state that has the desired text appearance. See Parts and States.

pszText [in]

Type: LPCWSTR

Pointer to a string that contains the text to draw.

iCharCount [in]

Type: int

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]

Type: DWORD

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

pRect [in, out]

Type: LPRECT

Pointer to a RECT structure that contains the rectangle, in logical coordinates, in which the text is to be drawn.

pOptions [in]

Type: const DTTOPTS*

A DTTOPTS structure that defines additional formatting options that will be applied to the text being drawn.

Return value

Type: HRESULT

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

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.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Uxtheme.h

Library

UxTheme.lib

DLL

UxTheme.dll

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ