[SOLVED] Win32 Main Window BG Colour

Started by
0 comments, last by dashurc 15 years, 3 months ago
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]
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.

This topic is closed to new replies.

Advertisement