找回密码
 加入
搜索
查看: 1728|回复: 10

执行自动化到最后一步,需要手动点击该窗口,才能继续!

  [复制链接]
发表于 2010-1-4 00:48:53 | 显示全部楼层 |阅读模式
本帖最后由 bearpc 于 2010-1-4 09:45 编辑



问题:执行自动化到最后一步,如上图,需要手动点击该窗口,才能继续自动化操作,不知有何解决方法?

软件:KMPlayer中文版 2009 Release

AU3代码:
Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWait($hd,"欢迎使用")
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")

WinWait($hd,"许可证协议")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")

WinWait($hd,"百度工具栏")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")

WinWait($hd,"选择安装位置")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")

WinWait("The KMPlayer Wizard","")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")

Sleep(800)
If ProcessExists("iexplore.exe") Then
    ProcessClose("iexplore.exe")
   
EndIf

WinWaitActive($hd,"正在完成")
ControlClick($hd,"","Button4")
ControlClick($hd,"","Button2")
下面为正确代码:
Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWait($hd,"欢迎使用")
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")

WinWait($hd,"许可证协议")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")

WinWait($hd,"百度工具栏")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")

WinWait($hd,"选择安装位置")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")

WinWait("The KMPlayer Wizard","")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")

Sleep(800)
If ProcessExists("iexplore.exe") Then
    ProcessClose("iexplore.exe")
   
EndIf

ControlCommand ($hd,"运行 KMPlayer中文版","Button4","UnCheck" )
ControlClick($hd,"","Button2")

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-1-4 01:03:04 | 显示全部楼层
ProcessClose (WinGetProcess ("安装 - 影音先锋"))

能否搜索一下…
我上午才回复一个相同的问题
发表于 2010-1-4 01:29:42 | 显示全部楼层
ControlCommand ( "title", "text", controlID, "UnCheck" )
发表于 2010-1-4 08:32:11 | 显示全部楼层
可以用controlclick ("标题","文本","控件ID")
如果只想用键盘的话,试下激活窗口能行不或者你试试用TAB能切换的到不,能切换的到就再加个回车就行了
发表于 2010-1-4 09:17:55 | 显示全部楼层
直接发一个SEND命令也可以
发表于 2010-1-4 09:34:03 | 显示全部楼层
Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")
ProcessWait("iexplore.exe")
ProcessClose("iexplore.exe")
WinWait($hd,"正在完成")
WinActivate($hd,"正在完成")
WinWaitActive($hd,"正在完成")
Send ("{SPACE}")
Send ("!f")
试了2次,没出问题!
 楼主| 发表于 2010-1-4 09:40:22 | 显示全部楼层
本帖最后由 bearpc 于 2010-1-4 09:42 编辑

解决方法
Run("kmplayer2009.exe")
$hd="KMPlayer中文版 2009 Release 安装"
TrayTip( "正在安装KMPlayer中文版 2009 Release","安装过程中请不要执行任何操作,否则程序无法自动安装",10,1)
WinWait($hd,"欢迎使用")
WinWaitActive($hd,"欢迎使用")
ControlClick($hd,"","Button2")

WinWait($hd,"许可证协议")
WinWaitActive($hd,"许可证协议")
ControlClick($hd,"","Button2")

WinWait($hd,"百度工具栏")
WinWaitActive($hd,"百度工具栏")
ControlClick($hd,"百度工具栏","Button4")
ControlClick($hd,"百度工具栏","Button2")

WinWait($hd,"选择安装位置")
WinWaitActive($hd,"选择安装位置")
ControlClick($hd,"","Button2")

WinWait("The KMPlayer Wizard","")
WinWaitActive("The KMPlayer Wizard","")
Send("!a")

Sleep(800)
If ProcessExists("iexplore.exe") Then
    ProcessClose("iexplore.exe")
   
EndIf

ControlCommand ($hd,"运行 KMPlayer中文版","Button4","UnCheck" )
ControlClick($hd,"","Button2")
 楼主| 发表于 2010-1-4 09:44:13 | 显示全部楼层
试了2次,没出问题!
59123608 发表于 2010-1-4 09:34



方法可以,只是使用键盘过多,出错率高!
 楼主| 发表于 2010-1-4 09:46:31 | 显示全部楼层
ceoguang 发表于 2010-1-4 01:29



   谢谢这位仁兄了
发表于 2010-1-4 10:10:31 | 显示全部楼层
弱弱的问,是不是窗口没激活?
少了WinActive
 楼主| 发表于 2010-1-4 11:49:44 | 显示全部楼层
回复 10# Allreal


    是的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-28 00:48 , Processed in 0.091765 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表