用ControlClick,给你个例子。。。
在任务栏无显示的,用@SW_MINIMIZE,又显示的用@SW_HIDE
不知明白否#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=net.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_Res_Comment=kn007@126.com
#AutoIt3Wrapper_Res_Description=由kn007制作
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=kn007
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
Run("RUNDLL32 netshell.dll,StartNCW");最好不动鼠标,不然有时不行的
$hd="New Connection Wizard";把这里改为你中文版的窗口名,一般为 新建连接向导
WinWait($hd)
WinSetState($hd, '', @SW_MINIMIZE)
ControlClick($hd,"","Button2");注意Button后的数字,自己看看相不相同,你按下一步,再按上一步,按键数字会发生变化
ControlClick($hd,"","Button6")
ControlClick($hd,"","Button2")
ControlClick($hd,"","Button9")
ControlClick($hd,"","Button2")
ControlClick($hd,"","Button12")
Sleep(100);为了确保可行,可以不要的,不过这个应该得留着
ControlSetText($hd,"","Edit1","宽带连接")
Sleep(200)
ControlClick($hd,"","Button12")
Sleep(300)
ControlSetText($hd,"","Edit1","test");用户名
ControlSetText($hd,"","Edit2","test");密码
ControlSetText($hd,"","Edit3","test");再次密码
ControlClick($hd,"","Button17")
Sleep(200)
ControlCommand($hd,"","Button1","Check","");该良好了。。。
ControlClick($hd,"","Button21")
Sleep(100)
Exit
这是上次帮人写的源码 |