Click to See Complete Forum and Search --> : DeferWindowPos()


MrDoomMaster
February 15th, 2005, 10:34 PM
Sometimes my controls don't draw correctly when I use the DeferWindowPos functions. Like, if a control temporarily overlaps another control, the control that was overlapped will not redraw the part that was overlapped, so it looks like a piece of the control has another piece of it stuck to it...

Any idea what I can do to make DeferWindowPos actually redraw every control fully?

NoHero
February 16th, 2005, 04:53 AM
Take a look at EndDeferWindowPos():

The EndDeferWindowPos function simultaneously updates the position and size of one or more windows in a single screen-refreshing cycle.

You should call it after all changes are made.

MrDoomMaster
February 16th, 2005, 10:34 AM
Actually, I do...


Here's what I do:



BeginDeferWindowPos()....

for(.....)
{
DeferWindowPos(...) // For every child window
}

EndDeferWindowPos(....)


And I continuously execute the above code whenever WM_SIZE is called, or OnSIze(). As you can see, this is my resizing class. But it is possible in for controls to overlap at some point, depending on how the user moves the dialog and how the controls are configured to align.

Does that help more?

Andreas Masur
February 16th, 2005, 10:39 AM
What flags are you passing?