Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C++ Libraries / March 2005

Tip: Looking for answers? Try searching our database.

window background color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jay.johansen - 15 Mar 2005 17:07 GMT
I have an old-but-still-lively app (like myself !) that looks fine on Windows
98 or 2000. But when we run the same code on Windows XP, it works, but the
background color of STATIC's is not the same as the background color of the
"outer" window, so it looks like there's a box of a different color around
every label. We set the background color of the outer window in RegisterClass
to COLOR_BACKGROUND. I don't see any place to set the background color of a
STATIC. I can hard-code a color in the RegisterClass that makes it look right
on my XP machine, but then the colors are different in 2000. Am I doing
something wrong here? I thought COLOR_BACKGROUND was supposed to get me
whatever the background color is on this particular computer. Is there some
way to ask what background color is being used for STATICs? Or am I supposed
to do something to set their background color to an appropriate value? Or can
I somehow make them transparent?

PS I'm still using Visual C++ v6.0. If I need to buy a newer compiler to
make something work, I can do that, but I work for the government and it will
take months to get a purchase request through, so before I bother I want to
know if that has anything to do with it.
Tim Robinson - 15 Mar 2005 21:37 GMT
>I have an old-but-still-lively app (like myself !) that looks fine on
>Windows
[quoted text clipped - 7 lines]
> a
> STATIC.
[...]

COLOR_BACKGROUND is the desktop colour. Static controls, like most other
controls, use COLOR_3DFACE to draw themselves. You can change a static
control's colour by handling WM_CTLCOLORSTATIC in the parent.

Signature

Tim Robinson
MVP, Windows SDK

jay.johansen - 15 Mar 2005 23:39 GMT
Thanks. Turns out I had another error in that same block of code -- adding
one outside the cast instead of inside. I've apparently been using incorrect
code, copied from program to program, since 1995 when I first learned Windows
C++, and it just managed to work until XP came along. Something
philosophically amusing about that. Thanks for the help.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.