The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: zemtex on January 18, 2011, 07:52:45 PM

Title: Flicker problems
Post by: zemtex on January 18, 2011, 07:52:45 PM
Hi.

I am using double buffering techniques and I am denying the system of processing WM_ERASEBKGND and erasing the background. The screen draws beautifully and doesnt flicker, but my button in the lower region of the window does flicker from time to time.

Is there a smart solution to this (other than removing the button) ?

The only solution I can see right now is to draw the button manually to avvoid it from updating every time "InvalidateRect" generates a WM_PAINT message.
Title: Re: Flicker problems
Post by: qWord on January 18, 2011, 08:02:55 PM
specify the WS_CLIPCHILDREN-style for the parent window.

qWord
Title: Re: Flicker problems
Post by: zemtex on January 18, 2011, 08:21:41 PM
I set the WS_CLIPCHILDREN style on the same window that I am drawing to, the very window that also have that button which flickers. The button flicker have seem to stopped now.

Can you give a technical explanation of what is happening beneath the surface here?
Title: Re: Flicker problems
Post by: qWord on January 18, 2011, 08:28:36 PM
without clipping the area of the child-window (button) gets overdrawn ->this force the control to be redrawn subsequently.
Title: Re: Flicker problems
Post by: zemtex on January 18, 2011, 08:40:24 PM
Good explanation. This is a good solution when having a few number of controls on the window.