5月份的时候我写的:
If not Dialog("Dialog").Exist Then '判断QQ窗口是否已经打开如果没打开就打开
SystemUtil.Run "F:\ziga\Tencent\qq\CoralQQ.exe","","F:\ziga\Tencent\qq","open"
End If
'~~~~~~~~~~~~~下面是在GLOBAL上付值
UserID=DataTable("QQ号码",gtGlobalSheet)
Pwd=DataTable("QQ密码",gtGlobalSheet)
Zidongdenglu=DataTable("自动登录",gtGlobalSheet)
Yinshen=DataTable("隐身登录",gtGlobalSheet)
Shezhi=DataTable("设置",gtGlobalSheet)
Anquan=DataTable("安全检查",gtGlobalSheet)
LonginMode=DataTable("登录模式",gtGlobalSheet)
NetSettingKind=DataTable("网络设置类型",gtGlobalSheet)
NetSettingADD=DataTable("网络设置地址",gtGlobalSheet)
NetPort=DataTable("网络设置端口",gtGlobalSheet)
NetUser=DataTable("网络设置用户",gtGlobalSheet)
NetPwd=DataTable("网络设置密码",gtGlobalSheet)
NetWorld=DataTable("网络设置域",gtGlobalSheet)
NetTest=DataTable("测试",gtGlobalSheet)
ChangeServer=DataTable("选择QQ登录服务器",gtGlobalSheet)
LonginServer=DataTable("登录服务器类型",gtGlobalSheet)
LonginAddress=DataTable("需要登录的服务器地址",gtGlobalSheet)
LonginPort=DataTable("需要登录的服务器端口",gtGlobalSheet)
Dialog("Dialog").WinEdit("window id:=1001","index:=0").Set UserID '输入QQ号码
Dialog("Dialog").WinEdit("window id:=16038","index:=1").Set Pwd '输入密码
If Zidongdenglu="Y" Or Zidongdenglu="y" Then '是否自动登录
Dialog("Dialog").WinCheckBox("regexpwndtitle:=自动登录").Set "on"
End If
If Yinshen="Y" Or Yinshen="y" Then '是否隐身登录
Dialog("Dialog").WinCheckBox("regexpwndtitle:=隐身登录").Set "on"
End If
If Shezhi="Y" Or Shezhi="y" Then '是否选择了设置,选择设置后就要对代理等处理
Dialog("Dialog").WinButton("regexpwndtitle:= 设置↓").Click
If NetSettingKind="不使用代理" Then
Dialog("Dialog").WinComboBox("window id:=16001","index:=0").Select 0
ElseIf NetSettingKind="SOCKS5代理" Then
Dialog("Dialog").WinComboBox("window id:=16001","index:=0").Select 1
ElseIf NetSettingKind="HTTP代理" Then
Dialog("Dialog").WinComboBox("window id:=16001","index:=0").Select 2
ElseIf NetSettingKind="使用浏览器设置" Then
Dialog("Dialog").WinComboBox("window id:=16001","index:=0").Select 3
End If
If NetSettingKind="SOCKS5" Or NetSettingKind="HTTP代理" Then
Dialog("Dialog").WinEdit("window id:=16002","index:=0").Set NetSettingADD
Dialog("Dialog").WinEdit("window id:=16004","index:=0").Set NetPort
If NetUser<>"" and NetPwd<>"" Then
Dialog("Dialog").WinEdit("window id:=16003","index:=0").Set NetUser
Dialog("Dialog").WinEdit("window id:=16005","index:=0").Set NetPwd
End If
If NetSettingKind="HTTP代理" and NetWorld<>"" Then
Dialog("Dialog").WinEdit("attached text:=域(可不填):","index:=0").Set NetWorld
End If
If NetTest="Y" or NetTest="y" Then
Dialog("Dialog").WinButton("regexpwndtitle:= 测试").Click
Dialog("Dialog").Dialog("QQ").WinButton("window id:=2").Click
End If
End If
If ChangeServer="Y" or ChangeServer="y" Then
Dialog("Dialog").WinCheckBox("window id:=16031").Set "on"
Dialog("Dialog").WinComboBox("WinComboBox").Select LonginServer
If LonginServer="" Then
Dialog("Dialog").Dialog("QQ").WinButton("window id:=1").Click
End If
Dialog("Dialog").WinComboBox("window id:=1001").Select LonginAddress
Dialog("Dialog").WinEdit("window id:1015").Set LonginPort
End If
If LonginMode<>"" Then
Dialog("Dialog").WinComboBox("window id:=16021","index:=0").Select LonginMode '登录模式(网吧,普通..)
End If
End If
Dialog("Dialog").WinButton("window id:=16032","index:=0").Click '点登录按钮
Wait(5)
If Dialog("regexpwndtitle:=服务器拒绝").Exist Then '对密码错误进行处理
Dialog("regexpwndtitle:=服务器拒绝").WinButton("window id:=1","index:=0").Click
End If
If Dialog("重启程序").Exist Then '对程序错误进行处理
Dialog("重启程序").WinButton("确定").Click
SystemUtil.Run "F:\ziga\Tencent\qq\CoralQQ.exe","","F:\ziga\Tencent\qq","open"
Wait(5)
End If
If Dialog("regexpwndclass:=#32770").WinObject("regexpwndclass:=Tencent_QQBar","index:=0").Exist Then '如果QQ密码对了就提示,程序就显示AAA,在这边就会停止继续运行,可以再进行修改让它把值写出来后继续运行
MsgBox "OH YEAH"
End If