When a warning message appears on my screen (after I try to run a program), I want to automatically close the warning message. But none of the IfWinExist/If WinExist/IfWinActive/If WinActive function is working.
What am I doing wrong?
Any help would be much appreciated.
Thanks
Code: Select all
SetTitleMatchMode, 2
run, C:\program.lnk
sleep 1000
IfWinExist, Open File
{
msgbox 1
}
IfWinActive, Open File
{
msgbox 2
}
IfWinExist, ahk_class #32770
{
msgbox 3
}
IfWinActive, ahk_class #32770
{
msgbox 4
}
If WinExist("Open File")
{
MsgBox 5
}
If WinExist("ahk_class #32770")
{
MsgBox 6
}
If WinActive("Open File")
{
MsgBox 7
}
If WinActive("ahk_class #32770")
{
MsgBox 8
}
esc::exitapp