I'm confused a little about system of repainting in Windows. If I send window a WM_PAINT message, it usally does nothing, because the update rectangle is empty. So I use InvalidateRect function to set the update rectangle. But my program also draws in the client area some graphics and on slow computers I could experience "flickering" effect on the toolbar. I found out that this is because the update rectangle is in such cases set to whole window. I found in help that you can use CS_CLIPSIBLINGS (or something like this) class style to let Windows remove all child windows from the update rectangle. But when I use it, buttons on toolbar stay pressed when I click them.
All I need to do is a program that redraws everything except child windows (I have a toolbar and a statusbar) everytime I send a WM_PAINT message to the main window and that redraws toolbar or statusbar whenever it's needed (user clicks a button on the toolbar or statusbar text changed).