Re: DrawThemeText always draws black text



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

.



Relevant Pages

  • Re: DrawThemeText always draws black text
    ... But it is black with black shadow. ... The font, however, seems to be OK. ... DrawThemeBackground (hTheme, hDC, WP_MAXCAPTION, MXCS_ACTIVE, &r, ...
    (microsoft.public.win32.programmer.ui)
  • DrawThemeText always draws black text
    ... But it is black with black shadow. ... The font, however, seems to be OK. ... DrawThemeBackground (hTheme, hDC, WP_MAXCAPTION, MXCS_ACTIVE, &r, ... DrawThemeText (hTheme, hDC, WP_MAXCAPTION, MXCS_ACTIVE, L"My ...
    (microsoft.public.win32.programmer.ui)
  • Re: DrawThemeText always draws black text
    ... "larschassing" wrote in message ... But it is black with black shadow. ... If I use MXCS_INACTIVE the shadow correctly disappears but the text is ... The font seems to be OK. ...
    (microsoft.public.win32.programmer.gdi)