Advertisement Jump to content


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


Changing window class attributes (MDI Backgrounds)

This topic is 5393 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

heya, How would I go about accessing and changing specific attributes (i.e. hbrBackground) from a pre-defined window class such as "MDICLIENT" in win32 c++? If this helps to make it more clear, I basically need to change the hbrBackground member of my MDI client window so I can change its background color. I've been able to change the color of the MDI Frame window, but as soon as the client window updates, its default MDI-gray is painted all over my lovely colored background on the frame window Thanks! Matt [edited by - Xtremehobo on April 15, 2004 10:36:02 PM]

Share this post

Link to post
Share on other sites
You don''t deal with the window class, you deal with the window. (Changing the attribute of the window class may or may not affect an already created window; it''s undefined AFAIK.) What you want to do is to change the background brush for that window; look into SelectObject and the various drawing functions cross-listed at the bottom of that page.

Share this post

Link to post
Share on other sites
I''m getting a bit confused now. How does SelectObject know which brush to change for my client window''s DC? I''m trying this code:

and it''s not changing anything. I probably sound pretty stupid right now because I''ve still got no idea what I''m doing.

Thanks for the help though

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!