Code: Select all
^F12 Up::
{
Sleep, 2000
If WinExist("ahk_exe notepad.exe.*")
msgbox exist
Sleep, 2000
If !WinExist("ahk_exe notepad.exe.*")
msgbox does not exist
Sleep, 2000
If WinActive("ahk_exe notepad.exe.*")
msgbox active
Sleep, 2000
If !WinActive("ahk_exe notepad.exe.*")
msgbox not active
return
}
I am desperate to get something like this working:
Code: Select all
^F12 Up::
{
doThis=
(
Sleep, 2000
If WinExist("ahk_exe notepad.exe.*")
msgbox exist
Sleep, 2000
If !WinExist("ahk_exe notepad.exe.*")
msgbox does not exist
Sleep, 2000
If WinActive("ahk_exe notepad.exe.*")
msgbox active
Sleep, 2000
If !WinActive("ahk_exe notepad.exe.*")
msgbox not active
)
fct(doThis)
return
fct(command)
{
(!exePath && exePath := A_AhkPath)
shell := ComObjCreate("WScript.Shell")
exec := shell.Exec(exePath . " *")
exec.StdIn.Write(command)
exec.StdIn.Close()
return exec.StdOut.ReadAll()
}
}
Is it a known limitation? Can the child not check on active windows etc.?