How do you programmatically resize and move windows with the Windows API?

For flicker-free, simultaneously positioning two (or more) windows, your best bet is to use BeginDeferWindowPos(), DeferWindowPos() and EndDeferWindowPos(). In your case, since you’re moving two at the same time, this is your best bet.

Three older, simpler functions you might also consider are SetWindowPos(), MoveWindow() and AdjustWindowRectEx().

Leave a Comment