The goal of the script is to be able to move and/or resize the gui, close/destroy the gui, then reopen the GUI at the same location and at the same size it was when closed/destroyed.
On starting the script it is the correct preset size. Then alternating display of the GUI using the hotkey and then Alt-F4 to close the GUI, the GUI grows larger in both width and height each iteration.
First to fourth display of the GUI:
Width 400 / 1032 / 2612 / 3876
Height 155 / 476 / 1278 / 2196
Code: Select all
#Persistent
Xcoord := 769
Ycoord := 389
Width := 400
Height := 155
#6::
Gui, destroy
Gui, +Resize
Gui, Add, Text, x12 y9 w360 h130, It is important to take care of the patient to be followed by the doctor.
Gui, Show, x%Xcoord% y%Ycoord% w%Width% h%Height%, Test Window
Return
GuiClose:
WinGetPos, Xcoord, Ycoord, Width, Height, Test Window
Clipboard := Width . "`r" . Height
Gui, destroy
Return