复制代码-
- #Region AutoIt3Wrapper 预编译参数(常用参数)
- #AutoIt3Wrapper_Icon= D:\Program Files\autoit3\Aut2Exe\Icons\FOLDER.ico ;图标,支持EXE,DLL,ICO
- #AutoIt3Wrapper_OutFile_Type=exe ;文件类型
- #AutoIt3Wrapper_Compression=4 ;压缩等级
- #AutoIt3Wrapper_UseUPX=y ;使用压缩
- #AutoIt3Wrapper_Res_Comment=Soft For Desktop lnks Management By FengWuji ;注释
- #AutoIt3Wrapper_Res_Description=Soft For Desktop lnks Management ;详细信息
- #AutoIt3Wrapper_Res_FileVersion=1.0.0 ;文件版本
- ;#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p ;自动更新版本
- #AutoIt3Wrapper_Res_LegalCopyright= 风无忌 ;版权
- ;#AutoIt3Wrapper_Change2CUI=N ;修改输出的程序为CUI(控制台程序)
- #AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% ;自定义资源段
- #AutoIt3Wrapper_Res_Field=Email|wzh880801@163.com ;自定义资源段
- ;#AutoIt3Wrapper_Run_Tidy= ;脚本整理
- ;#AutoIt3Wrapper_Run_Obfuscator= ;代码迷惑
- ;#AutoIt3Wrapper_Run_AU3Check= ;语法检查
- ;#AutoIt3Wrapper_Run_Before= ;运行前
- ;#AutoIt3Wrapper_Run_After= ;运行后
- #EndRegion AutoIt3Wrapper 预编译参数(常用参数)
- #NoTrayIcon
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <Array.au3>
- #Region ### START Koda GUI section ### Form=
- Global $reg1 = "HKEY_CLASSES_ROOT\lnkfile"
- Global $reg2 = "IsShortCut"
- Global $reg3 = $reg1 & "\" & $reg2
- FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
- FileInstall("vista_style.skf", @TempDir & "\vista_style.skf", 1)
- $Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")
- $Form1 = GUICreate("快捷方式小箭头管理工具 By FengWuji", 382, 307, 336, 182)
- DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
- DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
- DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", @TempDir & "\vista_style.skf")
- DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Form1, "int", 25)
- DllCall($Dll, "int:cdecl", "ApplySkin")
- $Group1 = GUICtrlCreateGroup("操作选项", 24, 184, 337, 73)
- $Radio1 = GUICtrlCreateRadio("删除快捷方式小箭头", 40, 216, 137, 17)
- GUICtrlSetState(-1, $GUI_CHECKED)
- $Radio2 = GUICtrlCreateRadio("恢复快捷方式小箭头", 200, 216, 137, 17)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Group2 = GUICtrlCreateGroup("", 24, 136, 337, 41)
- $Label2 = GUICtrlCreateLabel("快捷方式小箭头已经删除", 127, 152, 136, 17)
- $Label1 = GUICtrlCreateLabel("系统当前状态:", 40, 152, 79, 17)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- $Button1 = GUICtrlCreateButton("执行(&O)", 80, 272, 73, 25)
- $Button2 = GUICtrlCreateButton("取消(&E)", 224, 272, 73, 25)
- $Label3 = GUICtrlCreateLabel("2010年10月15日 星期五 14时23分50秒", 100, 10, 218, 17)
- $Group3 = GUICtrlCreateGroup("操作系统信息", 24, 32, 337, 97)
- $Label4 = GUICtrlCreateLabel("操作系统:", 38, 56, 55, 17)
- $Label5 = GUICtrlCreateLabel("系统版本:", 38, 77, 55, 17)
- $Label6 = GUICtrlCreateLabel("Microsoft Windows Xp", 134, 56, 155, 17)
- $Label7 = GUICtrlCreateLabel("Service Pack 3", 133, 77, 155, 17)
- $Label8 = GUICtrlCreateLabel(" 路漫漫其修远兮,吾将上下而求索。", 45, 102, 300, 17)
- GUICtrlCreateGroup("", -99, -99, 1, 1)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- Time()
- CheckOS()
- Judge()
- AdlibRegister("Time", 1000)
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Button2
- Exit
- Case $Button1
- ;以下2行代码诶测试所用
- ;MsgBox(0,GUICtrlGetState($Radio1),GUICtrlGetState($Radio2))
- ;Exit
- Local $var1 = GUICtrlGetState($Radio1)
- GUIDelete()
- If $var1 = 80 Then
- RegDelete($reg1, $reg2)
- If @error Then
- MsgBox(0 + 16, "操作失败", "程序3秒后自动退出!", 3)
- Exit
- EndIf
- ProcessClose("explorer.exe")
- Do
- Until Not ProcessExists("explorer.exe")
- Run(@SystemDir & "\explorer.exe", "", @SW_HIDE)
- Do
- Until ProcessExists("explorer.exe")
- MsgBox(0 + 48, "提示", "删除快捷方式小箭头成功!")
- Exit
- Else
- RegWrite($reg1, $reg2, "REG_SZ", "")
- If @error Then
- MsgBox(0 + 16, "操作失败", "程序3秒后自动退出!", 3)
- Exit
- EndIf
- ProcessClose("explorer.exe")
- Do
- Until Not ProcessExists('explorer.exe')
- Run(@SystemDir & "\explorer.exe", "", @SW_HIDE)
- Do
- Until ProcessExists("explorer.exe")
- MsgBox(0 + 48, "提示", "恢复快捷方式小箭头成功!")
- Exit
- EndIf
- EndSwitch
- WEnd
- ;时间函数
- Func Time()
- Local $wday
- Switch @WDAY
- Case 1
- $wday = "星期天"
- Case 2
- $wday = "星期一"
- Case 3
- $wday = "星期二"
- Case 4
- $wday = "星期三"
- Case 5
- $wday = "星期四"
- Case 6
- $wday = "星期五"
- Case 7
- $wday = "星期六"
- EndSwitch
- Local $time = @YEAR & "年" & @MON & "月" & @MDAY & "日" & " " & $wday & " " & @HOUR & ":" & @MIN & ":" & @SEC
- GUICtrlSetData($Label3, $time)
- EndFunc ;==>Time
- Func Judge()
- Local $array[10], $i
- For $i = 0 To 9 Step 1
- $array[$i] = RegEnumVal($reg1, $i + 1)
- If @error <> 0 Then ExitLoop
- Next
- ;MsgBox(0,$array[0],$array[2])
- _ArraySort($array)
- ;_ArrayDisplay($array)
- Local $var = _ArrayBinarySearch($array, "IsShortCut")
- If Not @error Then
- GUICtrlSetData($Label2, "快捷方式小箭头未删除")
- GUICtrlSetState($Radio2, $GUI_DISABLE)
- GUICtrlSetState($Radio1, $GUI_CHECKED)
- Else
- GUICtrlSetData($Label2, "快捷方式小箭头已经删除")
- GUICtrlSetState($Radio1, $GUI_DISABLE)
- GUICtrlSetState($Radio2, $GUI_CHECKED)
- EndIf
- EndFunc ;==>Judge
- Func CheckOS()
- Local $Osversion = @OSVersion
- Local $CSDVersion = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CSDVersion")
- Local $CurrentVersion = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "CurrentVersion")
- Switch $Osversion
- Case "WIN_2008R2"
- GUICtrlSetData($Label6, "Microsoft Windows 2008R2")
- Case "WIN_7"
- GUICtrlSetData($Label6, "Microsoft Windows 7")
- Case "WIN_2008"
- GUICtrlSetData($Label6, "Microsoft Windows 2008")
- Case "WIN_VISTA"
- GUICtrlSetData($Label6, "Microsoft Windows Vista")
- Case "WIN_2003"
- GUICtrlSetData($Label6, "Microsoft Windows 2003")
- Case "WIN_XP"
- GUICtrlSetData($Label6, "Microsoft Windows XP")
- Case "WIN_XPe"
- GUICtrlSetData($Label6, "Microsoft Windows XPE")
- Case "WIN_2000"
- GUICtrlSetData($Label6, "Microsoft Windows 2000")
- EndSwitch
- If $Osversion = "WIN_2008R2" Or $Osversion = "WIN_7" Or $Osversion = "WIN_2008" Or $Osversion = "WIN_VISTA" Then
- GUICtrlSetData($Label7, $CurrentVersion)
- Else
- GUICtrlSetData($Label7, $CSDVersion)
- EndIf
- If $Osversion = "WIN_2008R2" Or $Osversion = "WIN_7" Or $Osversion = "WIN_2008" Or $Osversion = "WIN_VISTA" Then
- GUICtrlSetData($Label8, "您的操作系统为" & @OSVersion & ",请确定用管理员身份运行本程序!")
- EndIf
- EndFunc ;==>CheckOS
|