Jump to content
  • Advertisement
Sign in to follow this  
dashurc

[SOLVED] Win32 Main Window BG Colour

This topic is 3589 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've solved my problem. I'll leave the original question, along with the solution I found in my reply... While this isn't really a game programming question, I figured someone might know the answer. I'm writing a program in Win32. All I want to know is how to set the background colour of my main window (not dialog boxes, etc.) I've tried calling SetBkColor before window initialization, after window initialization, when processing WM_PAINT messages, etc. Nothing seems to work (although calling it before rendering text using the TextOut function will colour the text background). I'm setting the background mode to OPAQUE (SetBkMode). If anyone knows what I should be doing, I'd appreciate a tip (I don't spend too much time with Win32, and the documentation isn't helping me troubleshoot). [Edited by - dashurc on December 22, 2008 3:16:51 AM]

Share this post


Link to post
Share on other sites
Advertisement
Nevermind, I missunderstood what SetBkColor does.

The proper way is to set the hbrBackground property of the WNDCLASSEX class when registering your window. I have it working now.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!