0
1

桌面提示

Au3编程学习2023-01-29 14:20重庆
4320
代码升级,点击字体打开配置文件编辑,点击时间去掉置顶
ESC退出
自带字体静默安装
自定义字体,字体颜色,大小,粗细。正常或/体





#Region ;**** 由 AccAu3Wrapper_GUI 创建指令 ****
#AccAu3Wrapper_Icon=..\..\多彩图标\bell.ico
#AccAu3Wrapper_Outfile=C:\Users\Administrator\Desktop\Twist_tips.exe
#AccAu3Wrapper_UseX64=n
#AccAu3Wrapper_Res_Language=2052
#AccAu3Wrapper_Res_requestedExecutionLevel=highestAvailable
#AccAu3Wrapper_Antidecompile=y
#EndRegion ;**** 由 AccAu3Wrapper_GUI 创建指令 ****
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WinAPIEx.au3>
#include <StaticConstants.au3>
#include <Process.au3>
HotKeySet("{ESC}", "_OnExit")
DirCreate(@WindowsDir & "\temp\font")
FileInstall("D:\AU3\Font\FontRegX86.exe", @WindowsDir & "\temp\font\FontRegX86.exe", 1)
FileInstall("D:\AU3\Font\FontRegX64.exe", @WindowsDir & "\temp\font\FontRegX64.exe", 1)
FileInstall("D:\AU3\Font\fonts.bat", @WindowsDir & "\temp\font\fonts.bat", 1)
FileInstall("D:\AU3\Font\时尚中黑简体.ttf", @WindowsDir & "\temp\font\时尚中黑简体.ttf", 1)
FileInstall("D:\AU3\Font\汉仪中隶书.ttf", @WindowsDir & "\temp\font\汉仪中隶书.ttf", 1)
FileInstall("D:\AU3\Font\隶书简体.ttf", @WindowsDir & "\temp\font\隶书简体.ttf", 1)
_RunDos('C:\Windows\temp\font\fonts.bat')
If FileExists(@ScriptDir & "\TS.ini") Then
Else
        FileInstall("D:\AU3\Font\TS.ini", @ScriptDir & "\TS.ini")
        FileSetAttrib(@ScriptDir & "\TS.ini", "+H", 1)
EndIf
Global $mht, $count = 0
Local $font = IniRead(@ScriptDir & "\TS.INI", "FONT", "fonts", "") ;字体名称
Local $fontdx = IniRead(@ScriptDir & "\TS.INI", "FONT", "fontsdx", "") ;字体大小
Local $fontcx = IniRead(@ScriptDir & "\TS.INI", "FONT", "fontscx", "") ;字体粗细
Local $fontzx = IniRead(@ScriptDir & "\TS.INI", "FONT", "fontszx", "") ;字体正/
Local $fontColo = IniRead(@ScriptDir & "\TS.INI", "FONT", "fontsColo", "") ;字体颜色
$MHT = GUICreate('', 700, 75, -1, 2, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOOLWINDOW)
GUISetState()
$Gui = GUICreate('', 700, 75, -1, 2, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_MDICHILD, $MHT)
GUISetBkColor(0x0000FF, $Gui)
GUICtrlCreateLabel("", 150, 33, 400, 2, $SS_BLACKRECT)
$Now = GUICtrlCreateLabel('', 12, 0, 676, 30, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, $fontdx, $fontcx, $fontzx, $font)
GUICtrlSetColor(-1, $fontColo)
GUICtrlSetTip(-1, "按ESC键退出")
$TSY = GUICtrlCreateLabel("", 0, 39, 700, 32, BitOR(0x1, 0x0300))
GUICtrlSetFont(-1, $fontdx, $fontcx, $fontzx, $font)
GUICtrlSetColor(-1, $fontColo)
GUICtrlCreateLabel("", 100, 73, 500, 2, $SS_BLACKRECT)
_WinAPI_SetLayeredWindowAttributes($Gui, 0x0000FF, 255) ;
WinSetOnTop("", "", 1)
GUISetState()
AdlibRegister('_MDate', 100)

Global $Num = 0
$Init = TimerInit()
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                        Do
                                $msg = GUIGetMsg()
                        Until $msg = $GUI_EVENT_CLOSE
                Case $TSY
                        ShellExecuteWait("notepad.exe", @ScriptDir & "\TS.ini")
                        Run("Twist_tips.exe")
                        Exit
                Case $Now
                        WinSetOnTop("", "", 0)
        EndSwitch
        $Time = TimerDiff($Init)
        If $Time / 5000 >= $Num Then
                $Num += 1
                _Main()
        EndIf
WEnd
Func _Main()
        $Info = IniRead(@ScriptDir & "\TS.ini", "Main", "Autoinfo" & $Num, "Twist")
        If $Info = "Twist" Then
                $Init = TimerInit()
                $Num = 1
                $Info = IniRead(@ScriptDir & "\TS.ini", "Main", "Autoinfo" & $Num, "Twist")
        EndIf
        GUICtrlSetData($TSY, $Info)
EndFunc   ;==>_Main
Func _OnExit()
        Exit
EndFunc   ;==>_OnExit
Func _MDate()
        Local $sDate
        Local $Date = StringFormat('%02s:%02s:%02s ' & ' %02s年%02s月%02s日', @HOUR, @MIN, @SEC, @YEAR, @MON, @MDAY)
        If $sDate <> $Date Then ControlSetText($Gui, '', $Now, $Date)
        $sDate = $Date
EndFunc   ;==>_MDate

查看附件

全部回复 0
www8899

主题: 54

回复: 171

关注: 0

粉丝: 2

TA 的积分
  • 1744
  • 84
  • 0