AU3自用工具箱发布
本帖最后由 cfanpc 于 2018-4-29 19:31 编辑界面和功能很简陋,大神见笑了哈。
#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Icon=C:\autoit3\Icons\MyAutoIt3_Green.ico
#PRE_Outfile=AU3工具箱.exe
#PRE_Compression=4
#PRE_UseUpx=n
#PRE_UseX64=n
#PRE_Res_Comment=AU3爱好者的工具箱
#PRE_Res_Fileversion=1.0.0.0
#PRE_Res_LegalCopyright=Copyright ? http://www.autoit3.cn/
#PRE_Res_requestedExecutionLevel=None
#PRE_Run_Tidy=y
#Tidy_Parameters=/rel
#PRE_Tidy_Stop_OnError=n
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include <WinAPIIcons.au3>
#Region ### START Koda GUI section ### Form=
Dim $DLL
If Not FileExists(@ScriptDir & '\Config.ini') Then
FileInstall('Config.ini', @ScriptDir & '\Config.ini', 1)
EndIf
$lnk = @DesktopDir & "\AU3工具箱.lnk"
If Not FileExists($lnk) Then
FileCreateShortcut(@ScriptFullPath, $lnk, @ScriptFullPath)
EndIf
If WinExists("AU3工具箱") Then
WinActivate("AU3工具箱")
Exit
EndIf
Global $sConfig = @ScriptDir & '\Config.ini'
Global $aConfig = IniReadSectionNames($sConfig)
Global $iButtonCount = $aConfig
Global $aButton[$iButtonCount] ;按钮总数
Global $iNumber = 4 ;每行按钮数量
Global $iSpacingX = 170, $iSpacingY = 60 ;垂直、水平,间距
Global $converjpg
Global $nBytes
Global $autoit = "HKLM\SOFTWARE\AutoIt v3\AutoIt"
Global $install = RegRead($autoit, "InstallDir")
Global $ver = RegRead($autoit, "Version")
If $install = "" Then $install = "未知"
If $ver = "" Then $ver = "0.0.0"
Opt('GUIOnEventMode', 1)
FileInstall("2.jpg", @TempDir & "\ap.tmp", 1)
FileInstall("1.jpg", @TempDir & "\afan.tmp", 1)
$pic = Random(1, 2, 1)
If $pic = 1 Then $pic = @TempDir & "\afan.tmp"
If $pic = 2 Then $pic = @TempDir & "\ap.tmp"
$Form1 = GUICreate("Autoit3 工具箱官网地址:http://www.autoit3.cn/", 696, 438)
GUISetFont(12, 400, 0, "MS Sans Serif")
GUISetOnEvent(-3, '_ButtonEvents')
$Pic1 = GUICtrlCreatePic($pic, 0, 0, 695, 111)
For $i = 0 To UBound($aButton) - 1
$aButton[$i] = GUICtrlCreateButton($aConfig[$i + 1], $iSpacingX * Mod($i, $iNumber) + 10, $iSpacingY * Floor($i / $iNumber) + 120, 150, 50)
GUICtrlSetFont(-1, 12, 700, "", "Arial")
;~ GUICtrlSetColor(-1, 0xFFFFFF)
;~ GUICtrlSetBkColor(-1, 0x3399FF)
GUICtrlSetOnEvent(-1, '_ButtonEvents')
Next
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
Local $aParts =
_GUICtrlStatusBar_SetParts($StatusBar1, $aParts)
_GUICtrlStatusBar_SetIcon($StatusBar1, 0, _WinAPI_LoadShell32Icon(2))
_GUICtrlStatusBar_SetText($StatusBar1, "Autoit目录:" & $install, 0)
_GUICtrlStatusBar_SetIcon($StatusBar1, 1, _WinAPI_LoadShell32Icon(40))
_GUICtrlStatusBar_SetText($StatusBar1, "版本:" & $ver, 1) ;运行状态:停止
_GUICtrlStatusBar_SetIcon($StatusBar1, 2, _WinAPI_LoadShell32Icon(265))
_GUICtrlStatusBar_SetText($StatusBar1, time(), 2)
_SkinGUI()
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(500)
WEnd
Func _ButtonEvents()
Switch @GUI_CtrlId
Case -3
Quit()
Case $aButton To $aButton
$sButtonText = GUICtrlRead(@GUI_CtrlId)
$sLink = IniRead($sConfig, $sButtonText, 'link', '')
ShellExecute(@ScriptDir & "\" & $sLink)
EndSwitch
EndFunc ;==>_ButtonEvents
Func time()
While 1
$string = "时间:" & @YEAR & "年" & @MON & "月" & @MDAY & "日" & _weekday() & @HOUR & ":" & @MIN & ":" & @SEC
Return $string
WEnd
EndFunc ;==>time
Func _weekday()
Switch @WDAY
Case 1
Return "星期日"
Case 2
Return "星期一"
Case 3
Return "星期二"
Case 4
Return "星期三"
Case 5
Return "星期四"
Case 6
Return "星期五"
Case 7
Return "星期六"
EndSwitch
EndFunc ;==>_weekday
Func _SkinGUI()
FileInstall("Skin.dll", @TempDir & "\Skin.dll", 1)
FileInstall("china.she", @TempDir & "\china.she", 1)
$Form1 = @TempDir & "\china.she"
$DLL = DllOpen(@TempDir & "\Skin.dll")
DllCall($DLL, "int", "SkinH_AttachEx", "str", $Form1, "str", "mhgd")
;~ DllCall($DLL, "int", "SkinH_SetAero", "int", 1)
EndFunc ;==>_SkinGUI
Func Quit()
GUISetState(@SW_HIDE)
DllCall($DLL, "int", "SkinH_Detach")
DllClose($DLL)
FileDelete(@TempDir & "\Skin.dll")
FileDelete(@TempDir & "\china.she")
Exit
EndFunc ;==>Quit
厉害了WORD的哥 回复 1# cfanpc
历害啊!也很实用! 源码修复了一个BUG,已打包的没有重新上传。你们自己看吧。 厉害厉害我的个神 太厉害了。多谢楼主分享! {:face (317):}
强,厉害
谢谢分享 也很实用!{:face (411):} 收集的工具很实用,谢谢。 厉害 谢谢分享! 收藏备用,谢谢分享。 工具很实用,厉害了我的哥 楼主我下载的不能运行。什么情况 重新下载了,还是不行。 回复 14# 虎虎虎
解决了。放到au3目录!