Click here to Skip to main content
15,029,433 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Recently, I added a status bar and a toolbar to the main window of my VC 2008 windows program. I noticed that the scroll bar ws scrollint these child window so I included a WS_CLIPCHILDREN to the main window's window style specification, but then I noticed the tool bar and the stutus bar don't resize when the main window is resized.

So in the WM_SIZE case of my main window's window procedure, I send WM_SIZE messages to the tool bar and status bar window. This seem to solve the problem but also introduced the problem is flickering.

Each time the main window is resized by dragging its border, the status bar and the tool bar flickers. How do I solve this problem?
Updated 2-Dec-10 8:51am
Slacker007 2-Dec-10 14:51pm
@Gbenbam: Try not to use overly long question titles next time. Thanks.

1 solution


This should help:
1 As you handle painting on resizing, remove CS_HREDRAW and CS_VREDRAW from your main window Class Styles[^].
2 Handle WM_ERASEBKGND (do nothing and return 1) in your main and children windows.

Gbenbam 21-Dec-10 8:11am
I have already done those.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900