My app exit when I press the ok button with the following code, but not when I close I close it by clicking on the cross:
Code: Select all
Gui,1: +AlwaysOnTop +ToolWindow +HwndMyWinHwnd
Gui, Color, Yellow
Gui, Margin, 50, 50
Gui, Add, Text, x50 y20, test)
Gui, Add, Button, x50 y50 w100 h18 ,OK
Gui, Show, w200 h100
Return
ButtonOK:
Sleep, 10000
GuiClose:
GuiEscape:
ExitApp
Return