Hi everybody,
I'm having problems drawing a window with child windows with a WM_PAINT handler without flickering.
I searched the forums a bit and I could see a lot of people with the same problems, but I couldn't really find an answer so here is my try:
Situation:
One window class registered:
style = CS_VREDRAW | CS_HREDRAW;
hbrBackground = (HBRUSH) COLOR_BACKGROUND+1;
One main window created:
dwExStyle = WS_EX_OVERLAPPEDWINDOW | WS_EX_COMPOSITED
dwStyle = WS_OVERLAPPEDWINDOW
And in this window, one child window is created:
dwExStyle = WS_EX_CLIENTEDGE
dwStyle = WS_CHILD
The child window is created in the WM_CREATE handler of the first one
WM_PAINT is handled by the child one (draws a static DIB on it)
All unhandled messages are handled by DefWindowProc()
The message-handling seems to be going fine, except for one thing:
Even though I'm using the WS_EX_COMPOSITED, the child window still flickers when I resize (gets a WM_PAINT due to CS_VREDRAW | CS_HREDRAW).
Even without handling the WM_PAINT in the child window, in which case the sunken border of the child window still flickers.
I must be doing something wrong, using the wrong styles or something, but I can't figure it out. Any suggestions? I'm trying to create a GUI where controls move around when the window is resized so afaik I can't turn off the CS_VREDRAW | CS_HREDRAW flag.
thanks in advance,
Jaap
