what should I do in order to close ALL IrfanView instances?
Code: Select all
#IfWinExist ahk_class IrfanView
+^space:: WinClose ahk_exe i_view64.exe
#IfWinActive
Code: Select all
#IfWinExist ahk_class IrfanView
+^space:: WinClose ahk_exe i_view64.exe
#IfWinActive
Code: Select all
#IfWinExist ahk_class IrfanView
+^space::
Loop
{
if WinExist("ahk_exe i_view64.exe")
{
WinClose, ahk_exe i_view64.exe
WinWaitClose, ahk_exe i_view64.exe
}
else
break
Sleep 100
}
return
#IfWinActive
Code: Select all
process=i_view64.exe
Process, Exist, %process%
if pid := ErrorLevel
{
Loop
{
WinClose, ahk_pid %pid%, , 2 ; will wait 2 sec for window to close
if ErrorLevel ; if it doesn't close
Process, Close, %pid% ; force it
Process, Exist, %process%
} Until !pid := ErrorLevel
}
return
^x::
ExitApp ;press ctrl-X to close the script, until you come up with your own way.
Code: Select all
+^Space::
While WinExist("ahk_class IrfanView")
WinClose
Return
Code: Select all
#IfWinActive, ahk_class IrfanView
+^Space::
While WinExist("ahk_class IrfanView")
WinClose
Return
#If ; off
Code: Select all
#If WinNotActive {"ahk_class AHK.ahk * SciTE4AutoHotkey"} or WinNotActive {"ahk_class TTOTAL_CMD"}
+^Space::
While WinExist("ahk_class IrfanView")
WinClose
Return
#If
Users browsing this forum: No registered users and 337 guests