Click to See Complete Forum and Search --> : Eliminating flicker when using a custom resize function


June 9th, 1999, 08:27 AM
I'm using a custom resize function so that the dialog I'm using automatically resizes the controls on it to keep certain distances between the controls
(Yes the controls grow if the dialog grows & shrink if the dialog shrinks)
The only problem so far it that the dialog flickers when ever you start to resize and move the mouse while resizing.

stopping the updating of the window won't help in the OnResize function

I have tried to stop updating when the mouse button goes down (OnLButtonDown)
but it looks like that function is never called when you hit the side of the dialog.

An OnIdle functions to update if the updating is turned of doesn't work either
never accessed in the dialog for some reason.

What do I need to do to get a flicker free resize option ?

ChrisD
June 9th, 1999, 09:26 AM
Look at WM_SIZING It is called whenever the user is sizing a window, when there done you see an LButtonUp (I have not found another way to know they are done). The other thing you could try is using BeginDeferWindowPos/DeferWindowPos/EndDeferWindowPos to move/size all the windows and when EndDeferWindowPos is called all the windows are moved at once therefore reducing flicker.


HTH,
chris

ChrisD
June 9th, 1999, 09:31 AM
Correction, you know the user is done sizing when you receive a 'WM_EXITSIZEMOVE'message.

Chris

June 10th, 1999, 06:18 AM
Thanks