Assuming guisize is required, the following result was found.
On Gui Resize Eventhttps://joellipman.com/articles/automation/autohotkey/on-gui-resize-event.html
a user resizes your program. If you search and search, you'll find that GuiClose responds to when you close the app, and GuiSize will run when you resize the app. Syntax: GuiSize: GuiControl, MoveDraw, MainRedBackground, w%A_GuiWidth% h%A_GuiHeight%...