#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_UseX64=n
#PRE_Res_requestedExecutionLevel=None
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include-once
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
Opt("GUIOnEventMode", 1) ;消息模式
Opt("MustDeclareVars", 1) ;所有变量使用前必须声明
Opt("TrayIconHide", 0) ;托盘图标 0 = 显示 1 = 隐藏
Opt("TrayAutoPause", 0) ;托盘图标暂停 0 = 不暂停 1 = 暂停
HotKeySet("{Esc}", "Quit")
Global $time
Global $ActExe = @ScriptDir & "\Windows loader.exe" ;Windows loader.exe与本脚本同目录
Global $Main = GUICreate("WIN7激活", 400, 142, -1, -1, $WS_POPUP)
GUICtrlCreateGroup("", 6, 2, 388, 60)
Global $Label_1 = GUICtrlCreateLabel('是否现在激活 WINDOWS 7 ? ( 不选择', 50, 30, -1, 16)
Global $Label_2 = GUICtrlCreateLabel('', 252, 30, 10, 16, $SS_CENTER)
Global $Label_3 = GUICtrlCreateLabel('秒后自动激活 )', 266, 30, -1, 16)
Global $Button_A = GUICtrlCreateButton("激活(&A)", 90, 80, 80, 26)
Global $Button_B = GUICtrlCreateButton("不激活(&C)", 230, 80, 80, 26)
Global $Line = GUICtrlCreateLabel("", 0, 125, 400, 2, $SS_SUNKEN)
Global $info_1 = GUICtrlCreateLabel("ESC(或Alt+C) = 不激活 Alt+A = 激活", 6, 128, 330, 16)
Global $info_2 = GUICtrlCreateLabel("| WIN7激活", 340, 128, 60, 16)
GUICtrlSetState($info_1, $GUI_DISABLE)
GUICtrlSetState($info_2, $GUI_DISABLE)
GUICtrlSetState($Button_A, $GUI_FOCUS)
GUICtrlSetTip($Button_A, "立即激活 Windows 7")
GUICtrlSetTip($Button_B, "不激活 Windows 7")
GUISetOnEvent($GUI_EVENT_CLOSE, "GUICtrlMsg")
GUICtrlSetOnEvent($Button_A, "GUICtrlMsg")
GUICtrlSetOnEvent($Button_B, "GUICtrlMsg")
GUISetState(@SW_SHOW)
For $time = 5 To 0 Step -1
;改变$time的初始值,就可以自定义倒计时时间
GUICtrlSetData($Label_2, $time)
Sleep(1000)
If $time = 0 Then _ActiveWin7()
Next
While 1
Sleep(1000)
WEnd
Func GUICtrlMsg()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE Or $Button_B
Quit()
Case $Button_A
_ActiveWin7()
EndSwitch
EndFunc ;==>GUICtrlMsg
Func _ActiveWin7()
;隐藏界面
GUISetState(@SW_HIDE, $Main)
;执行软激活
If FileExists($ActExe) Then
RunWait($ActExe & " /install /silent /norestart")
Else
MsgBox(64, "提示", "没有发现 Windows loader.exe. ")
EndIf
;退出
Quit()
EndFunc ;==>_ActiveWin7
Func Quit()
GUIDelete($Main)
Exit
EndFunc ;==>Quit