Gui Time Out?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
komobu
Posts: 22
Joined: 11 Sep 2014, 17:47

Gui Time Out?

16 Feb 2023, 09:36

I am using a gui as a message box so I can get a larger font. My OK button closes out the gui without closing the whole AHK file. Here is the code I am using to close out the gui
ButtonOK: ; Press to reload the app
reload
Return

not sure if there is a better way to close out the gui without closing the whole ahk file.

My main question though is how can I close the gui after 5 seconds if the OK Button hasnt been clicked?

Thanks for any help
User avatar
mikeyww
Posts: 27246
Joined: 09 Sep 2014, 18:38

Re: Gui Time Out?

16 Feb 2023, 10:32

Code: Select all

#Requires AutoHotkey v1.1.33
Gui Font, s10
Gui Add, Text  , w300        , Text text text
Gui Add, Button, wp   Default, OK
Gosub F3

F3::  ; F3 = Show the GUI
Gui Show,, Button (F3 = show again)
SetTimer ButtonOK, -5000
Return

ButtonOK:
Gosub GuiEscape
MsgBox 64, Status, Done!
Return

GuiEscape:
SetTimer ButtonOK, Off
Gui Hide
SoundBeep 2000
Return
komobu
Posts: 22
Joined: 11 Sep 2014, 17:47

Re: Gui Time Out?

16 Feb 2023, 11:11

Thank You!!! It works great

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, MrDoge, xulegos and 137 guests