draw text on a titlebar

  • Follow


Hi,

I'm having an hard time to figure out how to draw a text on the titlebar of 
a window under windows seven.
In the past , under XP, I used WM_NCPAINT and DrawText, but under seven this 
doesn't work (no text at all is drawn).
I then tried using a code like follows

HTHEME hTheme = OpenThemeData(hWnd,L"WINDOW");
SetBkMode(hDC,TRANSPARENT);
DrawThemeTextEx(hTheme, hDC, WP_CAPTION, CS_ACTIVE,  Text, -1, 
DT_SINGLELINE|DT_LEFT|DT_VCENTER, &rc, &dttOpts);
CloseThemeData(hTheme);

but it doesn't print the text either.
How can I solve this problem?

Thanks in advance for any help. 

0
Reply xxx861 (85) 12/7/2009 7:45:46 PM

4N wrote:
> Hi,
> 
> I'm having an hard time to figure out how to draw a text on the titlebar 
> of a window under windows seven.
> In the past , under XP, I used WM_NCPAINT and DrawText, but under seven 
> this doesn't work (no text at all is drawn).

Have you tried like in this article :
http://msdn.microsoft.com/en-us/library/bb688195(VS.85).aspx
0
Reply nico 12/7/2009 7:59:33 PM


Thanks a lot,
looks like what I was looking for.


"nico" <nico@nico.com> ha scritto nel messaggio 
news:hfjmuv$tr3$1@news.albasani.net...
>
> Have you tried like in this article :
> http://msdn.microsoft.com/en-us/library/bb688195(VS.85).aspx 

0
Reply 4N 12/8/2009 10:33:13 AM

2 Replies
506 Views

(page loaded in 0.078 seconds)

Similiar Articles:






7/22/2012 8:38:26 AM


Reply: