I have this script below, where I not only include some hotstring/hotkeys, but also have a GUI.
Right now the GUI only embeds a video.. but later, I want to display the values of many variables I plan to add to the script, thus I don't want to break the GUI out of this main script.
Rather keep it here in main.ahk.
I'll sum up the issue:
I want to be able to hit Control-F2, and the GUI pops up, where I can view variables, or play back the video.
But also want to be able to click the upper right X button, and thus dismiss it.
If I leave in the GuiClose:
Cancel:
ExitApp
in the script ( as you can see below, I have it commented it out ), then what happens is, the ExitApp completely stops running the entire script, and my hotkeys/hostring no longer works.
But if I remove the Exitapp, when I dismiss the GUI with the X button, the GUI window disappears,
but doesn't close its own resources.. so when I need the GUI again, I get an AHK error, that I can't start another instance of wmplayer, or similar.
So wondering how you handle having your GUI in your main script.
main.ahk
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#SingleInstance, Force
SetWorkingDir, A_ScriptDir
^F2::
Gui,1:Font, s12, Verdana ; Set 10-point Verdana.
file = myvideoiclip.mp4
Gui,1:Add, ActiveX, x5 y2 w400 h232 vWmp, WMPLayer.OCX
Wmp.Url := file
Gui,1:Show, w1100 h503, Dashboard
Return
;GuiClose:
;Cancel:
;ExitApp
::gpo::
Sleep 250
SendInput, git push origin
return
::gcmd::
Sleep 250
SendInput, git commit -m `"
SendInput, % jiranum " - message "
SendInput, `"
return
:*:reach::Thanks for reaching out
:*:jjira::
Sleep 250
SendInput % jiranum
return