If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

MFC MDI: How to change the background of the MDI main frame? (2)

Q: I have changed the MDI client background like in example shown above. Next, I have tried to draw a centered bitmap image, but encountered a strange behavior when resizing the frame window: the image is not entirely drawn or appears multiplied. I have tried both in 'WM_ERASEBKGND' and 'WM_PAINT' message handlers but without success. What I'm missing?

A: That happens because 'MDIClient' window class has not 'CS_VREDRAW' and 'CS_HREDRAW' styles (if 'CS_VREDRAW' and 'CS_HREDRAW' are set, the entire window is redrawn if a movement or size adjustment changes the width of the client area).

You can fix the problem by invalidate the client area in the 'WM_SIZE' message handler:

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.