Windows 2000 Artifacts (Almost!)
Posted on 2000-04-04
Here is a problem that have keept me awake all night.
I have a application that creates a "static" window with CreateWindowEx .. It shows a string in a window. I'm using WM_CTLCOLORSTATIC to change the background and the text color . Everything works perfectly under win9x/Winnt BUT not under Windows 2000.
Lets say that I create my window for 200x20 pixel even though that my string will only occupy 150x20 so there is a void in the window of 50x20 pixel. In Win2000 that void gets filled with a different color than the windows background and thereby creating some strange artifact..
The reason I need the window to bigger is because I change the text quite offen and I dont want to resize the window everytime I change the text!
So the question is, Do Win2000 handle WM_ERASEBACKGROUND different or what controls what color and how to fill the windows background ?