Code: Select all
If ProcessExist("spongeball.exe") && !WinExist ("ahk_exe spongeball.exe")
MsgBox Remember to turn off
ProcessExist(Name){
Process,Exist,%Name%
return Errorlevel
}
Code: Select all
If ProcessExist("spongeball.exe") && !WinExist ("ahk_exe spongeball.exe")
MsgBox Remember to turn off
ProcessExist(Name){
Process,Exist,%Name%
return Errorlevel
}
Code: Select all
A | (A ∧ ¬A)
--|---------
F | F
T | F
a process can exist without its window being shown. So back to my question - how can I check if a process exists BUT its window is not existswagfag wrote:since Porcess, Exist and WinExist when used with "ahk_exe" are effectively the same, u got this going on:
unreachable code, what are contradictions for 200, alex?Code: Select all
A | (A ∧ ¬A) --|--------- F | F T | F
Code: Select all
If ProcessExist("svchost.exe") && !WinExist("ahk_exe svchost.exe")
MsgBox Remember to turn off
ProcessExist(Name){
Process,Exist,%Name%
return Errorlevel
}
i see it works with svchost, however, with my game and even iexplore.exe it does not work, for example, if i have the process hidden (winhide) it will still see it as winexistswagfag wrote:youre right i overlooked that
the following works for me, the only thing ive modified from your original script was deleting the space between WinExist (), this is a syntax error and doesnt call the functionCode: Select all
If ProcessExist("svchost.exe") && !WinExist("ahk_exe svchost.exe") MsgBox Remember to turn off ProcessExist(Name){ Process,Exist,%Name% return Errorlevel }
Code: Select all
q::
DetectHiddenWindows, Off
MsgBox, % hWnd := WinExist("ahk_exe iexplore.exe")
WinGetTitle, vWinTitle, % "ahk_id " hWnd
WinGetClass, vWinClass, % "ahk_id " hWnd ;Alternate Owner
MsgBox, % vWinTitle "`r`n" vWinClass
SetTitleMatchMode, RegEx
MsgBox, % hWnd := WinExist(". ahk_exe iexplore.exe")
WinGetTitle, vWinTitle, % "ahk_id " hWnd
WinGetClass, vWinClass, % "ahk_id " hWnd
MsgBox, % vWinTitle "`r`n" vWinClass
return
I used your code to try to build a test. When I run the script it launched hidden IE. Now when I hit q I would like for it to tell me if there IE hidden or not.jeeswg wrote:I hid Internet Explorer, but still found a window with class 'Alternate Owner'. I set SetTitleMatchMode to RegEx, to make it look for a window that had a window title of at least one character, and then it didn't find any windows.Code: Select all
q:: DetectHiddenWindows, Off MsgBox, % hWnd := WinExist("ahk_exe iexplore.exe") WinGetTitle, vWinTitle, % "ahk_id " hWnd WinGetClass, vWinClass, % "ahk_id " hWnd ;Alternate Owner MsgBox, % vWinTitle "`r`n" vWinClass SetTitleMatchMode, RegEx MsgBox, % hWnd := WinExist(". ahk_exe iexplore.exe") WinGetTitle, vWinTitle, % "ahk_id " hWnd WinGetClass, vWinClass, % "ahk_id " hWnd MsgBox, % vWinTitle "`r`n" vWinClass return
Code: Select all
pwb := ComObjCreate("InternetExplorer.Application")
pwb.Visible := False
pwb.Navigate("https://www.google.com")
;while pwb.ReadyState != 4
sleep, 15000
pwb.quit()
Return
q::
DetectHiddenWindows, Off
MsgBox, % hWnd := WinExist("ahk_exe iexplore.exe")
WinGetTitle, vWinTitle, % "ahk_id " hWnd
WinGetClass, vWinClass, % "ahk_id " hWnd ;Alternate Owner
MsgBox, % vWinTitle "`r`n" vWinClass
SetTitleMatchMode, RegEx
MsgBox, % hWnd := WinExist(". ahk_exe iexplore.exe")
WinGetTitle, vWinTitle, % "ahk_id " hWnd
WinGetClass, vWinClass, % "ahk_id " hWnd
MsgBox, % vWinTitle "`r`n" vWinClass
return
esc::ExitApp
Code: Select all
q:: ;check if IE window exists
pwb := ComObjCreate("InternetExplorer.Application")
pwb.Visible := 0 ;False
hWnd := pwb.HWND
DetectHiddenWindows, On
MsgBox, % WinExist("ahk_id " hWnd)
DetectHiddenWindows, Off
;pwb.Visible := -1 ;True
pwb.Quit()
pwb := ""
WinWaitClose, % "ahk_id " hWnd
SoundBeep
DetectHiddenWindows, On
MsgBox, % WinExist("ahk_id " hWnd)
DetectHiddenWindows, Off
return
Users browsing this forum: Google [Bot], prototype_zero and 271 guests