mirror of
https://github.com/reactos/ahk_tests.git
synced 2024-11-27 05:20:25 +00:00
[AHK_Helper_Functions]
Add function to terminate specified process. Tested and works. svn path=/trunk/ahk_tests/; revision=1906
This commit is contained in:
parent
352b8cd68e
commit
0e83ae2ff1
@ -27,6 +27,23 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||
DetectHiddenText, Off ; Hidden text is not detected
|
||||
|
||||
|
||||
bTerminateProcess(szProcess)
|
||||
{
|
||||
Process, Exist, %szProcess%
|
||||
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
|
||||
if NewPID = 0
|
||||
TestsInfo("'" szProcess "' process does not exist.")
|
||||
else
|
||||
TestsInfo("'" szProcess "' process detected.")
|
||||
Process, Close, %szProcess%
|
||||
Process, WaitClose, %szProcess%, 4
|
||||
if ErrorLevel
|
||||
return false
|
||||
else
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
bIsConnectedToInternet()
|
||||
{
|
||||
szResult := false
|
||||
|
Loading…
Reference in New Issue
Block a user