#RequireAdmin
#include <MsgBoxConstants.au3>
#include <WinAPIHObj.au3>
#include <WinAPIProc.au3>
If Not _FindProcWithCmd("chrome.exe", "--force-renderer-accessibility") Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "Ошибка", 'Процесс "chrome.exe" с параметром командной строки "--force-renderer-accessibility" не найден')
Func _FindProcWithCmd($sProc, $sCmd)
Local $iPID, $iError, $aAdjust, $aProcs, $hToken
$iPID = 0
$hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY))
_WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust)
If @error Or @extended Then $iError = @error
$aProcs = ProcessList($sProc)
If @error Then $iError = @error
If Not $iError Then
For $i = 1 To $aProcs[0][0]
If StringInStr(_WinAPI_GetProcessCommandLine($aProcs[$i][1]), $sCmd) Then $iPID = $aProcs[$i][1]
Next
EndIf
_WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust)
_WinAPI_CloseHandle($hToken)
Return SetError($iError, 0, $iPID)
EndFunc ;==>_FindProcWithCmd