468,771 Members | 1,792 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,771 developers. It's quick & easy.

Question regarding window caption font and Windows XP theme

We have a problem with the Windows XP theme:
We have a IDE which allows other developers to develop visual programs for their customers.
Our IDE allow them to set font for window captions easyly (through a dialog). It works fine fo
W98, 2000, NT, and XP is the theme is Classic. But on XP if the theme is "Windows XP", the
we have a problem: if the developer set the caption font to be say, "Script" (and all non-default
font), then the caption will be displayed twice: first with the default System font&default size
then with the set font (Script) and the new size, and the second one (the script font) doesn't
override the first drawing completely; it doesn't matter if the Script size is smaller, or larger tha
the system default; the second caption is drawn slightly to the right

We traceed the C++ SDK we used to develop this IDE, and found that when we get Windows
message WM_NCPAINT, the processing looks like this

+WM_NCPAINT process begi
(within VM_NCPAINT, we will get the following msgs
+WM_GETTEXTLengt
-WM_GETTEXTLengt
+WM_GETTEX
-WM_GETTEX
-WM_NCPAINT process en

For all the classic Windows systems (and XP with theme set to Classic), if we set the caption strin
to NULL in WM_GETTEXT msg process code, then the window will be displayed without a caption
If we return a caption string, then the caption will be displayed using the font we set, Script in thi
example

On the other hand, for XP with XP theme, even if we set NULL the caption in WM_GETTEXT proces
code, the window will be displayed with a caption in default system font/size! Of couse, if we retur
a caption string, it will be drawn using the Script font, thus override the default one, and mess up

So, the question is: is the XP behaivour a bug? (should act the same like all the other Windows systems
Or, how can we disable the drawing of the caption in default font? (NOTE: we have tried the following
set caption to NULL; set font to Script; put the caption back ==> still the same error. Also tried settin
the Foreground color to that of the background, then change font == > same error. Looks like as
long as we have an option, XP will always display it using the default font first .

Thanks for any suggestions.
Nov 17 '05 #1
0 2776

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by Shaun McKinnon | last post: by
9 posts views Thread by Randall Sell | last post: by
4 posts views Thread by JeffP | last post: by
29 posts views Thread by wayne | last post: by
1 post views Thread by JD Kronicz | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.