?
Solved

Windows 2000 Artifacts (Almost!)

Posted on 2000-04-04
3
Medium Priority
?
190 Views
Last Modified: 2013-12-03
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 ?

/Erik

0
Comment
Question by:hougaard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Expert Comment

by:NickRepin
ID: 2683171
Try to set text/background color bySetTextColor, SetBkColor and return 0, but not the brush handle.
0
 
LVL 15

Accepted Solution

by:
NickRepin earned 400 total points
ID: 2683175
This is my answer.
0
 
LVL 2

Author Comment

by:hougaard
ID: 2683507
The correct answer is, use the NULL_BRUSH and make the window transparent.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question