Run ("QQ2010.exe")
WinWait("腾讯QQ2010 安装向导","欢迎使用腾讯QQ2010")
If Not WinActive("腾讯QQ2010 安装向导","欢迎使用腾讯QQ2010") Then WinActivate("腾讯QQ2010 安装向导","欢迎使用腾讯QQ2010")
WinWaitActive ("腾讯QQ2010 安装向导","欢迎使用腾讯QQ2010")
;等待指定窗口被激活后再执行下面的命令
ControlCommand ("腾讯QQ2010 安装向导","欢迎使用腾讯QQ2010","Button1","Check","")
;选中
Send("{ALTDOWN}n{ALTUP}")
WinWait("腾讯QQ2010 安装向导","请选择自定义安装选项与快捷方式选项")
If Not WinActive("腾讯QQ2010 安装向导","请选择自定义安装选项与快捷方式选项") Then WinActivate("腾讯QQ2010 安装向导","请选择自定义安装选项与快捷方式选项")
WinWaitActive ("腾讯QQ2010 安装向导","请选择自定义安装选项与快捷方式选项")
ControlCommand ("腾讯QQ2010 安装向导","请选择自定义安装选项与快捷方式选项","Button9","UnCheck","")
;选空 安装QQ工具栏及中文搜搜
ControlCommand ("腾讯QQ2010 安装向导","请选择自定义安装选项与快捷方式选项","Button10","UnCheck","")
;选空 安装QQ拼音输入法
Send("{ALTDOWN}n{ALTUP}")
WinWait("腾讯QQ2010 安装向导","请选择安装路径")
If Not WinActive("腾讯QQ2010 安装向导","请选择安装路径") Then WinActivate("腾讯QQ2010 安装向导","请选择安装路径")
WinWaitActive ("腾讯QQ2010 安装向导","请选择安装路径")
ControlSetText ("腾讯QQ2010 安装向导","请选择安装路径","Edit1","D:\Program Files\Tencent\QQ")
;修改指定控件的文本
Send("{ALTDOWN}i{ALTUP}")
;向指定控件发送鼠标点击命令
WinWait("腾讯QQ2010 安装向导","安装完成", 360)
If Not WinActive("腾讯QQ2010 安装向导","安装完成") Then WinActivate("腾讯QQ2010 安装向导","安装完成")
WinWaitActive ("腾讯QQ2010 安装向导","安装完成")
;等待指定窗口被激活后再执行下面的命令
ControlCommand ("腾讯QQ2010 安装向导","立即运行腾讯QQ2010","Button6","UnCheck","")
;选空 立即运行腾讯QQ2010
ControlCommand ("腾讯QQ2010 安装向导","开机时自动启动腾讯QQ2010","Button8","UnCheck","")
;选空 开机时自动启动腾讯QQ2010
ControlCommand ("腾讯QQ2010 安装向导","设置腾讯网为主页","Button9","UnCheck","")
;选空 设置腾讯网为主页
ControlCommand ("腾讯QQ2010 安装向导","显示新特性","Button7","UnCheck","")
;选空 显示新特性
Sleep(1000)
Send("{ALTDOWN}f{ALTUP}")