Tech Support > Microsoft Windows > Development Resources > MoveWindow() vs DeferWindowPos()
MoveWindow() vs DeferWindowPos()
Posted by Shizuka on May 5th, 2004


Is there any benefit to DeferWindowPos() instead
of using a sequence of MoveWindow() calls??
Is DeferWindowPos() really faster? why?

Also, what is the correct way to use DeferWindowPos()
if, say I want to move 4 child windows? Will it look
something like this? :

h = BeginDeferWindowPos (4);
DeferWindowPos (h, child1, ...);
DeferWindowPos (h, child2, ...);
DeferWindowPos (h, child3, ...);
DeferWindowPos (h, child4, ...);
EndDeferWindowPos (h);

------
S



Posted by Raymond Chen on May 6th, 2004


DeferWindowPos lets you move multiple windows at one go, avoiding
flicker.

http://msdn.microsoft.com/library/en...rwindowpos.asp

The documentation says, "The new handle that this function
returns should be passed during the next call to the
DeferWindowPos or EndDeferWindowPos function."

Therefore, the pattern is

h = BeginDeferWindowPos(4);
h = DeferWindowPos(h, child1, ...);
h = DeferWindowPos(h, child2, ...);
h = DeferWindowPos(h, child3, ...);
h = DeferWindowPos(h, child4, ...);
EndDeferWindowPos(h);

On Wed, 5 May 2004 09:31:10 -0700, "Shizuka" <rman@goodnet.com>
wrote:



Similar Posts