есть auto-hot-key-скрипт:
как правильно его добавить в этот auto-it-скрипт?
подробнее в этой теме
Код:
#NoTrayIcon
CoordMode, Mouse, Screen
SetDefaultMouseSpeed, 0
Click 352, 197, 2
как правильно его добавить в этот auto-it-скрипт?
Код:
#include <GuiListView.au3>
#include <GuiButton.au3>
#include <Misc.au3>
Global $hWnd, $hLVCntrl, $hButtOK
Global $sINIFile = @ScriptDir & '\uTFilter.ini'
Global $sTitle = '[CLASS:#32770;REGEXPTITLE:(Добав([А-яЁё]|\h)+?торр?ент)|(Add New Torrent)]'
Global $sLVCntrl = '[CLASS:SysListView32; INSTANCE:1]'
Global $sButtOK = '[CLASS:Button; ID:20]'
Global $Process = 'utorrent.exe'
Global $vINIParam = IniReadSection($sINIFile, 'Filter')
If @error Then Exit MsgBox(16, @ScriptName, 'Ошибка чтения "uTFilter.ini"!')
If $vINIParam[3][1] Then
HotKeySet($vINIParam[3][1], '_CBStateSwitch')
$vINIParam[3][1] = True
EndIf
While ProcessExists($Process)
$hWnd = WinActivate($sTitle)
If $hWnd Then
$hTimer = TimerInit()
If $vINIParam[4][1] Then WinSetTrans($hWnd, '', $vINIParam[4][1])
$hLVCntrl = ControlGetHandle($hWnd, '', $sLVCntrl)
$iCount = ControlListView($hWnd, '', $hLVCntrl, 'GetItemCount') - 1
Dim $aLVItems[$iCount + 1]
_GUICtrlListView_BeginUpdate($hLVCntrl)
If $vINIParam[2][1] == 0 Then _GUICtrlListView_SetItemChecked($hLVCntrl, -1, False)
For $i = $iCount To 0 Step -1
$sText = ControlListView($hWnd, '', $hLVCntrl, 'GetText', $i, 0)
If StringRegExp($sText, '(?i)\.(' & $vINIParam[1][1] & ')$') Then
$aLVItems[$i] = ''
_GUICtrlListView_DeleteItem($hLVCntrl, $i)
Else
$aLVItems[$i] = $sText
EndIf
Next
_GUICtrlListView_EndUpdate($hLVCntrl)
$hButtOK = ControlGetHandle($hWnd, '', $sButtOK)
If Not _MyButton() Then ContinueLoop
For $i = 0 To $iCount
If $aLVItems[$i] And Not _GUICtrlListView_GetItemChecked($hLVCntrl, _GUICtrlListView_FindText($hLVCntrl, $aLVItems[$i])) Then $aLVItems[$i] = ''
Next
_GUICtrlListView_BeginUpdate($hLVCntrl)
_GUICtrlListView_DeleteAllItems($hLVCntrl)
For $i = 0 To $iCount
_GUICtrlListView_AddItem($hLVCntrl, $aLVItems[$i])
If $aLVItems[$i] Then _GUICtrlListView_SetItemChecked($hLVCntrl, $i)
Next
ControlFocus($hWnd, '', $hButtOK)
ControlClick($hWnd, '', $hButtOK)
If Not WinWaitClose($hWnd, '', 3) Then WinClose($hWnd)
Else
Sleep(200)
EndIf
WEnd
Func _MyButton()
Local $aiPos, $sControl, $iPosPrevX, $iPosPrevY, $hButton, $aWndList
$aiPos = ControlGetPos($hWnd, '', $hButtOK)
$sControl = ControlGetFocus($hWnd)
If @error Then Return 0
$iPosPrevX = $aiPos[0]
$iPosPrevY = $aiPos[1]
$hButton = _GUICtrlButton_Create($hWnd, 'OK', $aiPos[0], $aiPos[1], $aiPos[2], $aiPos[3])
ControlHide($hWnd, '', $hButtOK)
ControlDisable($hWnd, '', $hButtOK)
ControlFocus($hWnd, '', $sControl)
While Sleep(10)
If Not WinExists($hWnd) Then Return 0
$aWndList = WinList($sTitle)
If $aWndList[0][0] > 1 Then
WinClose($aWndList[1][1])
WinActivate($hWnd)
EndIf
If _GUICtrlButton_GetState($hButton) = 0x0026C Then ExitLoop
If WinActive($hWnd) And _IsPressed('0D') Then ExitLoop
$aiPos = ControlGetPos($hWnd, '', $hButtOK)
If @error Then Return 0
If $iPosPrevX <> $aiPos[0] Or $iPosPrevY <> $aiPos[1] Then ControlMove($hWnd, '', $hButton, $aiPos[0], $aiPos[1])
WEnd
Return ControlEnable($hWnd, '', $hButtOK)
EndFunc ;==>_MyButton
Func _CBStateSwitch()
If Not WinActive($hWnd) Then Return
$vINIParam[3][1] = Not $vINIParam[3][1]
_GUICtrlListView_SetItemChecked($hLVCntrl, -1, $vINIParam[3][1])
EndFunc ;==>_CBStateSwitch
подробнее в этой теме