Компьютерный форум OSzone.net  

Компьютерный форум OSzone.net (http://forum.oszone.net/index.php)
-   AutoIt (http://forum.oszone.net/forumdisplay.php?f=103)
-   -   Не активируется окно (http://forum.oszone.net/showthread.php?t=133844)

podix 04-03-2009 23:38 1055214

Не активируется окно
 
Привет всем !!!
теперь другая у меня другая проблема После установки приложения появляется окно регистрации и я не могу его сделать активным чтоб записать туда ключ :(
Команды WinActivate и подобные не помогают :(
Вот моё творение

Цитата:

;предотвращение возможности множественного запуска скрипта
If WinExists(@ScriptName) Then Exit
AutoItWinSetTitle(@ScriptName)
;скрыть в системной панели индикатор AutoIt
;AutoItSetOption("TrayIconHide", 1)
;Отображать текущую строку сценария с помощью индикатора системной панели в режиме отладки.
AutoItSetOption("TrayIconDebug", 1)
AutoItSetOption("SendKeyDelay", 10)
If ProcessExists ( "ps.exe" )<>0 Then
ProcessClose ( "ps.exe" )
ProcessWaitClose ( "ps.exe" )
EndIf
BlockInput ( 1 )
Break(0)

Run ( @ScriptDir & '\' & 'allok_mp4converter.exe' )
WinWait( "Setup - Allok Video to MP4 Converter", "&Next >" )
WinActivate("Setup - Allok Video to MP4 Converter", "&Next >")
ControlClick ( "Setup - Allok Video to MP4 Converter", "&Next >", "TNewButton1")
WinWait("Setup - Allok Video to MP4 Converter","I &accept the agreement")
WinActivate("Setup - Allok Video to MP4 Converter","I &accept the agreement")
ControlClick("Setup - Allok Video to MP4 Converter","I &accept the agreement","TNewRadioButton1")
WinWait("Setup - Allok Video to MP4 Converter","&Next >")
WinActivate("Setup - Allok Video to MP4 Converter","&Next >")
ControlClick("Setup - Allok Video to MP4 Converter","&Next >","TNewButton2")
WinWait("Setup - Allok Video to MP4 Converter","&Next >")
WinActivate("Setup - Allok Video to MP4 Converter","&Next >")
ControlClick("Setup - Allok Video to MP4 Converter","&Next >","TNewButton3")
WinWait("Setup - Allok Video to MP4 Converter","&Don't create a Start Menu folder")
WinActivate("Setup - Allok Video to MP4 Converter","&Don't create a Start Menu folder")
ControlClick("Setup - Allok Video to MP4 Converter","&Don't create a Start Menu folder","TNewCheckBox1")
WinWait("Setup - Allok Video to MP4 Converter","&Next >")
WinActivate("Setup - Allok Video to MP4 Converter","&Next >")
ControlClick("Setup - Allok Video to MP4 Converter","&Next >","TNewButton4")
WinWait("Setup - Allok Video to MP4 Converter","Select Additional Tasks")
Send("{TAB}")
Send("{SPACE}")
WinWait("Setup - Allok Video to MP4 Converter","&Next >")
WinActivate("Setup - Allok Video to MP4 Converter","&Next >")
ControlClick("Setup - Allok Video to MP4 Converter","&Next >","TNewButton4")
WinWait("Setup - Allok Video to MP4 Converter","&Install")
WinActivate("Setup - Allok Video to MP4 Converter","&Install")
ControlClick("Setup - Allok Video to MP4 Converter","&Install","TNewButton4")
WinWait( "Setup - Allok Video to MP4 Converter", "&Finish" )
WinActivate("Setup - Allok Video to MP4 Converter", "&Finish")
ControlClick("Setup - Allok Video to MP4 Converter", "&Finish", "TNewButton4")
; Дальше ничего не идёт :(
WinActivate("Please register your copy", " Registration Process ")
WinWait("Please register your copy", " Registration Process ")

D_Master 04-03-2009 23:41 1055218

Цитата:

Цитата podix
WinActivate("Please register your copy", " Registration Process ")
WinWait("Please register your copy", " Registration Process ") »

у меня обычно идет наоборот - сначала WinWait, а затем WinActivate

266903582 05-03-2009 01:39 1055299

podix, попробуй так:
Код:


run('allok_mp4converter.exe')
cl('Setup - Allok Video to MP4 Converter','Welcome to the Allok Video to MP4 Converter Setup Wizard','TNewButton1')
cl('Setup - Allok Video to MP4 Converter','License Agreement','TNewRadioButton1')
cl('Setup - Allok Video to MP4 Converter','License Agreement','TNewButton2')
cl('Setup - Allok Video to MP4 Converter','Select Destination Location','TNewButton3')
cl('Setup - Allok Video to MP4 Converter','Select Start Menu Folder','TNewButton4')
cl('Setup - Allok Video to MP4 Converter','Select Additional Tasks','TNewButton4')
cl('Setup - Allok Video to MP4 Converter','Ready to Install','TNewButton4')
cl('Setup - Allok Video to MP4 Converter','Completing the Allok Video to MP4 Converter Setup Wizard','TNewButton4')
wa('Please register your copy','This is a free Unregistered Copy(Trial Version), Please register your copy, so you can use it in full functions.')
ControlSetText('Please register your copy','This is a free Unregistered Copy(Trial Version), Please register your copy, so you can use it in full functions.','Edit1','License_name');ВСТАВИТЬ ТЕКСТ СЮДА
wa('Please register your copy','This is a free Unregistered Copy(Trial Version), Please register your copy, so you can use it in full functions.')
ControlSetText('Please register your copy','This is a free Unregistered Copy(Trial Version), Please register your copy, so you can use it in full functions.','Edit2','license_code');ВСТАВИТЬ ТЕКСТ СЮДА
cl('Please register your copy','This is a free Unregistered Copy(Trial Version), Please register your copy, so you can use it in full functions.','Button4')
Func wa($tx1, $tx2)
        While Not WinExists($tx1, $tx2)
                Sleep(1)
        WEnd
EndFunc
Func cl($tx1, $tx2,$classn)
        wa($tx1, $tx2)
        ControlClick($tx1, $tx2,$classn)
EndFunc

Только замени лицензионные ключи...

podix 05-03-2009 17:05 1055804

266903582,
Расскажите что за команда WA
wa('Please register your copy','This

266903582 05-03-2009 17:45 1055837

Эта функция ждет появления окна. Передаем ей два параметра: заголовок и текст окна. Окно появляется - скрипт продолжает работать...

podix 05-03-2009 18:50 1055889

266903582,
wa - это WinWait ???
Есть ли справочник скороченых функций например wa-это WinWait и так со всеми командами
И как можно закрыть окно установленной программы???
За ответ заранее благодарен !!!

266903582 05-03-2009 19:12 1055909

Это не "скороченная" функция, просто две буквы, заменяющие мне написание нескольких строк цикла (лень мне много писать, проще пару кнопок нажать...). Сама функция определена в конце:
Код:

Func wa($tx1, $tx2)
        While Not WinExists($tx1, $tx2)
                Sleep(1)
        WEnd
EndFunc

Почитай раздел справки о пользовательских функциях!

podix 06-03-2009 12:58 1056426

Всё таки я не могу никак закрыть окно установленной программы
Не поддаётся ни каким командам :(

266903582,
Цитата:

Почитай раздел справки о пользовательских функциях!
Точнее где этот справочник ??? Я не могу найти :(

266903582 06-03-2009 13:36 1056456

http://forum.oszone.net/thread-129417.html в шапке для тебя много интересного,
в том числе и ссылка на справочник: http://www.autoitscript.com/autoit3/docs.shtml. Когда скачаешь его, смотри функцию WinClose ( "title", ["text"] )


Время: 05:51.

Время: 05:51.
© OSzone.net 2001-