[AHK_Helper_Functions]

Add function to terminate specified process.
Tested and works.

svn path=/trunk/ahk_tests/; revision=1906
This commit is contained in:
Edijs Kolesnikovičs 2012-11-30 08:13:06 +00:00
parent 352b8cd68e
commit 0e83ae2ff1

View File

@ -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