Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Dark Rain

Win32 question on XP

This topic is 5155 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I tried running one of the tools I created for a game under XP just to make sure it would work. To my surprise it didn't, the window background was white instead of using a window default color for "forms" to borrow from VB terms. I saw that one of my mistake was in my background brush setting (hbrBackground). I used (HBRUSH)(COLOR_WINDOW);, which gave me the right color but after a bit of reading on msdn, it seems that (HBRUSH)(COLOR_WINDOW + 1); is the correct syntax. Back to square one, this give me a white background under windows 2k, 98, 95 etc. So in short, my question is : How do I get a window I created myself to have the same background color as a windows dialog made via the ressource editor. I can't seem to come up with the right keywords on google even if this must be a fairly common problem. [edited by - Dark Rain on April 12, 2004 11:15:51 PM]

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
CreateSolidBrush(GetSysColor(COLOR_3DFACE));

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Glad I could help.

Share this post


Link to post
Share on other sites
Don't know if this is the problem but it's something to keep in mind: (COLOR_WINDOW + 1) does not have a definite color. It's whatever color the user has set on the "Appearance" tab of the "Display Properties" dialog.

Using COLOR_3DFACE is not advised since it too is not guaranteed to be any particular color. Using it may cause unexpected results if the user decides to customize the appearance of his or her system colors.

If your background has to be white, just use a white brush.

edit: Oops, didn't catch the fact that you're looking for the background color of a dialog. Sorry, the AP's right.

[edited by - Solo on April 13, 2004 2:15:14 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!