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.