This way it works:
Code: Select all
SetTimer "checkwin", 1000
checkwin() {
if !WinExist("ahk_exe snes9x-x64.exe")
ExitApp
}
Code: Select all
AhkName := "ahk_exe snes9x-x64.exe"
SetTimer "checkwin", 1000
checkwin() {
if !WinExist("%AhkName%")
ExitApp
}
Code: Select all
AhkName := "snes9x-x64.exe"
SetTimer "checkwin", 1000
checkwin() {
if !WinExist("ahk_exe %AhkName%")
ExitApp
}
I tried in many ways and nothing to accept the variable.