Partilhar via


AFX_GLOBAL_DATA::DrawTextOnGlass

Draws the specified text in the visual style of the specified theme.

BOOL DrawTextOnGlass(
   HTHEME hTheme, 
   CDC* pDC, 
   int iPartId, 
   int iStateId, 
   CString strText, 
   CRect rect, 
   DWORD dwFlags, 
   int nGlowSize = 0, 
   COLORREF clrText = (COLORREF)-1
);

Parameters

  • [in] hTheme
    Handle to the theme data of a window, or NULL. The framework uses the specified theme to draw the text if this parameter is not NULL and themes are supported. Otherwise, the framework does not use a theme to draw the text.

    Use the OpenThemeData method to create an HTHEME.

  • [in] pDC
    Pointer to a device context.

  • [in] iPartId
    The control part that has the desired text appearance. For more information, see the Parts column of the table in Parts and States. If this value is 0, the text is drawn in the default font, or a font selected into the device context.

  • [in] iStateId
    The control state that has the desired text appearance. For more information, see the States column of the table in Parts and States.

  • [in] strText
    The text to draw.

  • [in] rect
    The boundary of the area in which the specified text is drawn.

  • [in] dwFlags
    A bitwise combination (OR) of flags that specify how the specified text is drawn.

    If the hTheme parameter is NULL or if themes are not supported and enabled, the nFormat parameter of the CDC::DrawText method describes the valid flags. If themes are supported, the dwFlags parameter of the DrawThemeTextEx method describes the valid flags.

  • [in] nGlowSize
    The size of a glow effect that is drawn on the background before drawing the specified text. The default value is 0.

  • [in] clrText
    The color in which the specified text is drawn. The default value is the default color.

Return Value

TRUE if a theme is used to draw the specified text; otherwise, FALSE.

Remarks

A theme defines the visual style of an application. For more information, see Themes and Visual Styles. A theme is not used to draw the text if the hTheme parameter is NULL, or if the DrawThemeTextEx method is not supported, or if Desktop Window Manager (DWM) composition is disabled.

Requirements

Header: afxglobals.h

See Also

Reference

AFX_GLOBAL_DATA Structure

Hierarchy Chart

Themes and Visual Styles

COLORREF

Parts and States

CDC::DrawText

DrawThemeTextEx

Desktop Window Manager

Enable and Control DWM Composition