Posts: 1,769
Threads: 410
Joined: Feb 2003
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....
thanks.
Posts: 12,086
Threads: 142
Joined: Dec 2002
Save window dimensions and later restore:
int cx cy h=win("Notepad")
GetWinXY(h 0 0 &cx &cy)
;...
siz cx cy h
or
int h=win("Notepad")
RECT r0; GetWindowRect(h &r0)
;...
MoveWindow(h r0.left r0.top r0.right-r0.left r0.bottom-r0.top 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"