Кнопка "Войти" не отрабатывает
Попробуйте заменить
Код:
Код: Выделить всё
;...
ControlClick($h_Win, '', $n_Button)
;на
ControlSend($h_Win, '', '', '{ENTER}')
;или на
ControlSend($h_Win, '', $n_Button, '{ENTER}')Код: Выделить всё
;...
ControlClick($h_Win, '', $n_Button)
;на
ControlSend($h_Win, '', '', '{ENTER}')
;или на
ControlSend($h_Win, '', $n_Button, '{ENTER}')Код: Выделить всё
$hWin = WinGetHandle('[Title:Ultr@VNC Авторизация;Class:#32770]')
If $hWin Then
MsgBox(64, 'Info', ControlGetHandle($hWin, '', '[Class:Button;Instance:1]'))
Else
MsgBox(16, 'Error', 'Нет окна')
EndIfКод: Выделить всё
#NoTrayIcon
#include ;Yashied, http://autoit-script.ru/index.php.htm/topic,47.0.html
Opt('MustDeclareVars', 1)
Opt('TrayMenuMode', 1)
Global $sTitleScript = @ScriptName & '{[/@$@\]}', $sTitleLogPass = '[Title:Ultr@VNC Авторизация;Class:#32770]', _
$sTitlePass = '[Title:VNC Авторизация;Class:#32770]', $fLogPass, $fPass, $nExitItem, $msg
If WinExists($sTitleScript) Then Exit
AutoItWinSetTitle($sTitleScript)
HotKeySet('{Esc}', '_Exit')
$nExitItem = TrayCreateItem('Выход')
TraySetState()
TraySetToolTip('' & @LF & 'Выход - нажать кнопку "Esc"')
_WinAPI_EmptyWorkingSet()
While 1
$msg = TrayGetMsg()
If WinExists($sTitleLogPass) Then
If Not $fLogPass Then
_AvtorLogPass()
If Not @error Then $fLogPass = True
EndIf
Else
$fLogPass = False
EndIf
If WinExists($sTitlePass) Then
If Not $fPass Then
_AvtorPass()
If Not @error Then $fPass = True
EndIf
Else
$fPass = False
EndIf
Switch $msg
Case 0
ContinueLoop
Case $nExitItem
_Exit()
EndSwitch
WEnd
Func _AvtorLogPass()
Local $h_Win, $n_Log = '[Class:Edit;Instance:1]', $n_Pass = '[Class:Edit;Instance:2]', _
$n_Button = '[Class:Button;Instance:1]', $s_Log = 'TestUser', $s_Pass = 'TestPass';свои данные поставьте
$h_Win = WinGetHandle($sTitleLogPass)
If Not $h_Win Then Return SetError(1)
If Not ControlSetText($h_Win, '', $n_Log, $s_Log) Then Return SetError(1)
If Not ControlSetText($h_Win, '', $n_Pass, $s_Pass) Then Return SetError(1)
ControlClick($h_Win, '', $n_Button)
If WinExists($h_Win) Then Return SetError(1)
Return SetError(0)
EndFunc ;==>_AvtorLogPass
Func _AvtorPass()
Local $h_Win, $n_Pass = '[Class:Edit;Instance:1]', $n_Button = '[Class:Button;Instance:1]', _
$s_Pass = 'TestPass';свои данные поставьте
$h_Win = WinGetHandle($sTitlePass)
If Not $h_Win Then Return SetError(1)
If Not ControlSetText($h_Win, '', $n_Pass, $s_Pass) Then Return SetError(1)
ControlClick($h_Win, '', $n_Button)
If WinExists($h_Win) Then Return SetError(1)
Return SetError(0)
EndFunc ;==>_AvtorPass
Func _Exit()
Exit
EndFunc ;==>_Exit