Click to See Complete Forum and Search --> : Good old flickering Problem...


Roemer
October 25th, 2004, 05:49 AM
I'm unable to solve this flickering problem :(

I'm trying for days now and searched over a lot of forums but somehow couldn't find an answer yet.

The problem is that when I have some window controls (like button) which should resize when their parent window is resized, they flicker.

The only solution that will work would be Double Buffering I guess. So far so good. But how the h... do I paint controls (button, ltext, edittext) and so on into the offscreen area?
And will it work if I defined the control elements in a resource file?

I added a very simple example as attachment.

Thanks for helping
//Roemer

Bond
October 25th, 2004, 09:15 AM
Have you tried using the WS_CLIPCHILDREN style?

JasonD
October 25th, 2004, 10:15 AM
Look into the WS_EX_COMPOSITED style. It performs double buffering for you. Keep in mind that this works only on Windows XP, and with this style, the 'x' close button will not visually respond to user actions (although it still works). My solution to this glitch is to turn on this extended style only during a moving/sizing modal loop, which can be determined with these messages: WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE.

Amn
October 25th, 2004, 11:35 AM
WS_CLIPCHILDREN shoudl do the trick

kawasaki056
October 25th, 2004, 01:12 PM
i have a solution.
use ExcludeCluipRect()"
i hesitate to give this info,
because there were few example | explanation about this funcytion,and i experimented abd found it works. this is my service for you !

it's useful when WM_CLIPCHILDREN not set, want to handle update of window your self.

well , i leave you to find hoe to use it.

so, just EXCLUDE flickering area.parameter "hdc" is (HDC)wp at "WM_ERASEBKGND". coods are of course parent's client coords.
use MapWindowPoint(s?)...it's easy