Re: DrawThemeText always draws black text
- From: "Lars C. Hassing" <lars.c.hassing@xxxxxxxxx>
- Date: 27 Feb 2007 15:27:27 -0800
On 24 Feb., 18:08, Christian ASTOR <casto...@xxxxxxxxxxxxxxxx> wrote:
Lars C. Hassing wrote:
The DrawThemeText documentation says:
"Draws text using the color and font defined by the visual style."
So I would expect a caption text in the default Windows XP blue theme
to be white with black shadow.
But it is black with black shadow.
If I use MXCS_INACTIVE the shadow correctly disappears but the text is
still black (not white (grey)).
The font, however, seems to be OK.
DrawThemeBackground (hTheme, hDC, WP_MAXCAPTION, MXCS_ACTIVE, &r,
NULL);
DrawThemeText (hTheme, hDC, WP_MAXCAPTION, MXCS_ACTIVE, L"My
Caption", -1, DT_VCENTER | DT_SINGLELINE | DT_LEFT | DT_NOPREFIX, 0,
&r);
I have tried SetTextColor with no luck.
The color is GetSysColor(COLOR_CAPTIONTEXT)
that can be drawn with DrawThemeTextEx()(>XP) or DrawText() or part of
DrawNCPreview()- Skjul tekst i anførselstegn -
Hi Christian,
yes, GetSysColor(COLOR_CAPTIONTEXT / COLOR_INACTIVECAPTIONTEXT)
seem to get me the right text colors, and
GetThemeColor(hTheme, PartId, StateId, TMT_TEXTSHADOWCOLOR, &Color);
gets me the correct shadow color, so I can then call DrawText() twice.
GetThemeColor(hTheme, PartId, StateId, TMT_TEXTCOLOR, &Color);
returns an error (0x80070490) ?
The font I can get from
GetThemeSysFont(hTheme,TMT_CAPTIONFONT, &lf);
whereas
GetThemeFont(hTheme, dc->m_hDC, PartId, StateId, TMT_GLYPHFONT, &lf);
also returns an error (0x80070490).
However, the font does not have the antialias bit set.
I really thought DrawThemeText was supposed to do all this work for
me ?
/Lars
.
- References:
- DrawThemeText always draws black text
- From: Lars C. Hassing
- Re: DrawThemeText always draws black text
- From: Christian ASTOR
- DrawThemeText always draws black text
- Prev by Date: Re: Tray Icon not nice
- Next by Date: Re: Create a WS_CHILD window in another thread with its own WinPro
- Previous by thread: Re: DrawThemeText always draws black text
- Next by thread: Reloading the Theme
- Index(es):
Relevant Pages
|