Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
window restore
after a siz command, how can i tell qm to "restore" the window size the way it was before it was resized? especially if there has been hours and numerous commands between the first resizing and the restore... (i want to create a "window shade" effect with this). res doesnt seem to do it....

Save window dimensions and later restore:

int cx cy h=win("Notepad")
GetWinXY(h 0 0 &cx &cy)


siz cx cy h


int h=win("Notepad")
RECT r0; GetWindowRect(h &r0)


MoveWindow(h r0.left r0.right-r0.left 1)

if restore must be in other macro, declare variables as global (int+ cx cy, etc),
or save to Registry (rset cx "xxx" ... rget cx "xxx").
Alternatively, use function ArrangeWindows which can save to registry and later
restore dimensions of single or multiple windows:

ArrangeWindows 6 "Notepad"


ArrangeWindows 7 "Notepad"

Forum Jump:

Users browsing this thread: 1 Guest(s)