找回密码
 加入
搜索
查看: 2287|回复: 1

[原创]WinActiveX控件--稳定的发送键盘鼠标控制的函数

  [复制链接]
发表于 2008-10-12 12:52:34 | 显示全部楼层 |阅读模式
ShellExecute("极品五笔6.exe")
While ProcessExists("极品五笔6.exe")
WinActiveX("安装 - 极品五笔Win98/Me/2000/Xp通用版","欢迎使用极品五笔输入法安装向导","{Enter}")
WinActiveX("安装 - 极品五笔Win98/Me/2000/Xp通用版","许可协议","!a{Enter}")
WinActiveX("安装 - 极品五笔Win98/Me/2000/Xp通用版","选择目标位置","{Enter}")
WinActiveX("安装 - 极品五笔Win98/Me/2000/Xp通用版","准备安装","{Enter}")
WinActiveX("安装 - 极品五笔Win98/Me/2000/Xp通用版","完成","")
ControlClick("安装 - 极品五笔Win98/Me/2000/Xp通用版","完成","TNewCheckListBox1","","1",45,10)
ControlClick("安装 - 极品五笔Win98/Me/2000/Xp通用版","完成","TNewCheckListBox1","","1",42,29)
Send("{Enter}")
WEnd

Func WinActiveX($title,$text,$send);;;;;激活并向控件发送键盘控制
;;;三个参数分别代表“窗口标题”、“窗口文本”、“键盘输入”,没有的请输入""
        WinWait($title,$text,1200);;;;;;;;;;等待窗口生成限时1200秒
        WinActivate($title,$text)
        WinWaitActive($title,$text)
        if $send<>"" Then
        $i=0               
                While WinExists($title,$text)=1 And $i<10
                        If WinActive($title,$text)=1 Then
                                Send($send)
                                $i+=1
                        Else
                                WinActivate($title,$text)
                                Send($send)
                                $i+=1
                        EndIf
                WEnd               
        EndIf       
EndFunc
发表于 2008-10-14 07:29:33 | 显示全部楼层
收藏,再慢慢学,能加多些注解就更好
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-19 01:27 , Processed in 0.074873 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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