Code: Select all
(gui:= GuiCreate())
.OnEvent("Close", "gui_OnClose")
gui.Add("Text",, "Press Enter")
gui.Add("Button","Default w0 h0")
.OnEvent("Click", "btn_OnClick")
gui.Show()
gui_OnClose(*) {
return MsgBox("Enter for Close",, "OC") == "Cancel"
}
btn_OnClick(*) {
global
gui.Hide() ; <<< Close without asking ???
}
I understand that this function corresponding to EVENT "OnClose", in true GUI have "CLOSE" procedure that is unavailable or undocumented.
In other words WHEN "Close" EVENT then call OnEvent function, but this is not "CLOSE" procedure it is "IF" to do close or not. So I think it is logically OnClose to be called any time when GUI start CLOSE.
The only way I found:
Code: Select all
btn_OnClick(*) {
global
Send("!{F4}")
;gui.Hide() ; <<< Close without asking ???
}
Gui.Close() is just WinClose(Gui)
Code: Select all
btn_OnClick(*) {
global
WinClose(gui)
}