How do you programmatically resize and move windows with Windows API?
The scenario is: I want to vertically tile two windows (80%/20% width proportions).
How do you programmatically resize and move windows with Windows API?
The scenario is: I want to vertically tile two windows (80%/20% width proportions).
Use SetWindowPos() in the Windows API.
Given a HWND, you can change the z-order, position (upper left), size, as well as numerous other flags (like showing or hiding, making it the active window or not, etc).
You're looking for one of SetWindowPos, MoveWindow and AdjustWindowRectEx.
Can you be more specific about the scenario so that we can recomend the most appropriate 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 best.
Three older, simpler functions you might also consider are SetWindowPos(), MoveWindow() and AdjustWindowRectEx().