#include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Opt('TrayMenuMode', 1)
Global $aProcess, $sFile, $j = 0, $aAutoIt[$j + 1], $sTitle = 'Поиск процессов AutoIt', _
$sMessage = 'Нет ни одного процесса AutoIt.'
If WinExists(@ScriptName) Then Exit
AutoItWinSetTitle(@ScriptName)
$aProcess = ProcessList()
If Not @error Then
For $i = 1 To $aProcess[0][0]
$sFile = _WinAPI_GetProcessFileName($aProcess[$i][1])
If _FileIsAutoItScript($sFile) And $sFile <> @ScriptFullPath Then
$j += 1
ReDim $aAutoIt[$j + 1]
$aAutoIt[$j] = $sFile
EndIf
Next
If $j Then
$sMessage = 'Найдено процессов AutoIt: ' & $j & @CRLF & @CRLF
For $n = 1 To $j
$sMessage &= $aAutoIt[$n] & @CRLF
Next
EndIf
MsgBox(64, $sTitle, $sMessage)
Else
MsgBox(16, $sTitle, 'Ошибка.')
EndIf
Func _FileIsAutoItScript($sExeFile)
Local $sSignature = BinaryToString('0xA3484BBE986C4AA9994C530A86D6487D')
Local $sRead = FileRead($sExeFile)
Return StringInStr($sRead, $sSignature) > 0
EndFunc ;==>_FileIsAutoItScript