#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_icon=C:\Windows\system32\SHELL32.dll|-16
#PRE_Outfile=..\Documents\Desktop\开机优化.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#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=
DirCreate ("d:\开机优化工具箱" ) ;创建文件夹
FileInstall("1.jpg","d:\开机优化工具箱\1.jpg")
FileInstall("分辨率设置.exe","d:\开机优化工具箱\分辨率设置.exe");打包图片,编译图片(图片资源必须与脚本在同一文件夹内)
FileInstall("关闭多余的IDE通道.exe","d:\开机优化工具箱\关闭多余的IDE通道.exe")
Dim $dll
$hwnd = GUICreate("完美XP优化程序",600, 400, 310, 100,-1, $WS_EX_TOPMOST) ;$WS_POPUP 无边框
$Pic1 = GUICtrlCreatePic("d:\开机优化工具箱\1.jpg",0,0,600,400);图片
$Progress1 = GUICtrlCreateProgress(59,370, 475, 11)
;GUICtrlCreateLabel("完美XP正在最后优化,键鼠已锁定。", 0, 0, 75, 25)
;GUICtrlCreateLabel("本网吧网速过快,请看管好随身物品。", 10, 25, 190, 15)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hwnd, "int", 1000, "long", 0x00080000) ;1000 表示时间,越大过程越久
;GUISetOnEvent($GUI_EVENT_CLOSE, "_exit")
GUICtrlSetData(-1, 20)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
inst_main()
delfile()
;_exit()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_Exit()
EndSwitch
WEnd
Func inst_main()
GUICtrlSetData($Progress1, 10)
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, 30)
WinWaitClose("新建连接向导","正在完成新建连接向导")
run("d:\开机优化工具箱\关闭多余的IDE通道.exe")
winwaitactive("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
Send("{ENTER}")
GUICtrlSetData($Progress1, 50)
WinWaitClose ("启动速度优化","安装前请确认已经装好驱动程序,按确定键进行优化")
run("d:\开机优化工具箱\分辨率设置.exe")
winwaitactive("分辨率智能设置","显示器智能判断")
Send("{tab}{tab}{ENTER}")
Sleep(5000);暂停5秒
Send("{esc}")
GUICtrlSetData($Progress1, 80)
WinWaitClose("分辨率智能设置","显示器智能判断")
DirRemove("d:\开机优化工具箱",1 );删除文件夹
BlockInput(0);开启鼠标键盘
Run(@ComSpec&' /c ping 127.0.0.1 -n 3&del /q "'&@ScriptFullPath&'"',@ScriptDir,@SW_HIDE)
GUICtrlSetData($Progress1, 100)
_Exit()
EndFunc
Func delfile()
;FileDelete(@TempDir & "\1.jpg");删除图片
_Exit()
EndFunc
Func _Exit()
For $GUI_TRANS = 240 To 0 Step -5 ;STEP值越小,过程越久
If $GUI_TRANS > 0 Then WinSetTrans($hwnd, "", $GUI_TRANS)
Sleep(10) ;Sleep值越大,过程越久
Next
Exit
EndFunc