Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Script Start - Add your code below here
- $iPID="Process.exe";имя процесса
- $link="";полный путь
- While 1
- $title=_ProcessGetWindow($iPID,0)
- If (StringInStr($title, "(Не отвечает)")) Then
- ProcessClose($iPID)
- ProcessWaitClose ($iPID)
- Run($link)
- EndIf
- Sleep(1000)
- WEnd
- Func _ProcessGetWindow($iPID, $iRet = 1)
- Local $aWinList = WinList()
- Local $aRet[2]
- If IsString($iPID) Then
- $iPID = ProcessExists($iPID)
- EndIf
- For $i = 1 To UBound($aWinList) - 1
- If WinGetProcess($aWinList[$i][1]) = $iPID Then
- $aRet[0] = $aWinList[$i][0] ;Title
- $aRet[1] = $aWinList[$i][1] ;WinHandle
- If $iRet = 0 Then
- Return $aRet[0]
- EndIf
- If $iRet = 1 Then
- Return $aRet[1]
- EndIf
- Return $aRet
- EndIf
- Next
- Return SetError(1, 0, $aRet)
- EndFunc ;==>_ProcessGetWindow
Add Comment
Please, Sign In to add comment