本帖最后由 scum 于 2012-7-28 06:53 编辑
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Opt("TrayiconDebug", 1)
Opt("WinDetectHiddenText", 1)
#Region ### START Koda GUI section ### Form=
FileInstall("1.jpg",@TempDir & "\1.jpg");打包图片,编译图片(图片资源必须与脚本在同一文件夹内)
Dim $dll
$hwnd = GUICreate("完美XP优化程序",800, 600, 310, 100) ;无边框
$Pic1 = GUICtrlCreatePic(@TempDir &"\1.jpg",0,0,800,600);图片
$Progress1 = GUICtrlCreateProgress(126,490, 550, 25)
DllCall("user32.dll", "int", "完美XP优化程序", "hwnd", $hwnd, "int", 500, "long", 0x00080000)
GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUICtrlSetData(-1, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
inst_main()
delfile()
_exit()
While 1
Sleep(1000)
WEnd
Func _exit()
Exit
EndFunc
Func inst_main()
run("RUNDLL32 netshell.dll,StartNCW")
BlockInput(1);屏蔽鼠标键盘
winwaitactive("新建连接向导","新建连接向导")
send("!N")
winwaitactive("新建连接向导","连接到 Internet(&C)")
send("!N")
winwaitactive("新建连接向导","从 Internet 服务提供商(ISP)列表选择(&L)")
send("!M!N")
winwaitactive("新建连接向导","新建连接向导")
send("!U!N")
winwaitactive("新建连接向导","在下面框中输入您的 ISP 的名称")
send(Eval("宽带连接"))
send("!N!N")
winwaitactive("新建连接向导","正在完成新建连接向导")
send("!S{ENTER}")
If WinActive("网络配置","确定") then
Send("{ENTER}{esc}")
EndIf
GUICtrlSetData($Progress1, 10)
WinWaitClose("新建连接向导","正在完成新建连接向导")
run("D:\Documents and Settings\Perfect\桌面\优化工具\关闭多余的IDE通道.exe")
winwaitactive("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
Send("{ENTER}")
WinWaitClose ("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
run("D:\Documents and Settings\Perfect\桌面\优化工具\分辨率设置.exe")
winwaitactive("分辨率智能设置","显示器智能判断")
Send("{tab}{tab}{ENTER}")
Sleep(5000);暂停5秒
Send("{esc}")
WinWaitClose("分辨率智能设置","显示器智能判断")
DirRemove("D:\Documents and Settings\Perfect\桌面\优化工具",1 )
Run(@ComSpec&' /c ping 127.0.0.1 -n 3&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE)
Exit
EndFunc
Func delfile()
FileDelete(@TempDir & "\1.jpg");删除图片
Exit
EndFunc
|