Цитата El Sanchez:
ControlGetText - возвращает пустую строку »
|
А если так попробовать:
Код:

#NoTrayIcon
#include <WinAPIEx.au3>;Yashied, http://autoit-script.ru/index.php/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('<VNC Авторизация>' & @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