#include <GuiTreeView.au3>
#include <GuiListView.au3>
;проверял только на Windows XP 32, ESET Smart Security 3.0.684.0 rus
$iError = 1
$hWinEset = WinGetHandle('[Title:ESET Smart Security; Class:Eset Client Frame]')
If Not $hWinEset Then Exit -11
ControlSend($hWinEset, '', '', '{F5}')
$hWin = WinWait('[Title:ESET Smart Security; Class:#32770]', '', 5)
If Not $hWin Then Exit -22
For $j = 1 To 1
$hTreeView = ControlGetHandle($hWin, '', '[CLASS:SysTreeView32; INSTANCE:1]')
If Not $hTreeView Then ExitLoop
;_GUICtrlTreeView_Expand($hTreeView);???
$hItem = _GUICtrlTreeView_FindItem($hTreeView, 'Активный режим')
If Not $hItem Then ExitLoop
_GUICtrlTreeView_EnsureVisible($hTreeView, $hItem)
If Not _GUICtrlTreeView_SelectItem($hTreeView, $hItem) Then ExitLoop
$hListView = ControlGetHandle($hWin, '', '[CLASS:SysListView32; INSTANCE:1]')
If Not $hListView Then ExitLoop
For $i = 1 To 5
$iCount = _GUICtrlListView_GetItemCount($hListView)
If $iCount Then ExitLoop
Sleep(1000)
Next
If Not $iCount Then ExitLoop
$iRand = Random(0, $iCount - 1, 1)
$sText = ''
For $i = 0 To $iCount - 1
_GUICtrlListView_EnsureVisible($hListView, $i)
$fCheck = _GUICtrlListView_GetItemChecked($hListView, $i)
_GUICtrlListView_SetItemChecked($hListView, $i, Not $fCheck)
$sMessage = StringFormat('Index:\t%d (0 - %d)\tText:\t%s\nIs Checked:\t%s', $i, $iCount - 1, _
_GUICtrlListView_GetItemText($hListView, $i), $fCheck)
ToolTip($sMessage, 0, 0)
If $i = $iRand Then $sText = _GUICtrlListView_GetItemText($hListView, $i)
Sleep(1000)
_GUICtrlListView_SetItemChecked($hListView, $i, $fCheck)
Next
If $sText Then
ToolTip('Find: ' & $sText, 0, 0)
$iIndex = _GUICtrlListView_FindInText($hListView, $sText)
If $iIndex < 0 Then ExitLoop
_GUICtrlListView_EnsureVisible($hListView, $iIndex)
$fCheck = _GUICtrlListView_GetItemChecked($hListView, $iIndex)
_GUICtrlListView_SetItemChecked($hListView, $iIndex, Not $fCheck)
Sleep(3000)
_GUICtrlListView_SetItemChecked($hListView, $iIndex, $fCheck)
Sleep(1000)
EndIf
$iError = 0
Next
ToolTip('')
ControlClick($hWin, '', '[CLASS:Button; INSTANCE:8]');Отмена
If $iError Then
MsgBox(16, 'Error', 'Error')
Exit -33
Else
MsgBox(64, 'Info', 'OK')
EndIf