Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
window restore
#1
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.
#2
Save window dimensions and later restore:

Code:
Copy      Help
int cx cy h=win("Notepad")
GetWinXY(h 0 0 &cx &cy)

;...

siz cx cy h

or

Code:
Copy      Help
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:

Code:
Copy      Help
ArrangeWindows 6 "Notepad"

;...

ArrangeWindows 7 "Notepad"


Forum Jump:


Users browsing this thread: 1 Guest(s)