LED时间显示
```Global Const $USER_DEFAULT=1024,$GREGORIAN=1
Global Const $MONTH_NAME=20,$ABV_MONTH_NAME=33
Global Const $DAY_NAME=5,$ABV_DAY_NAME=12
Global Const $WS_EX_TOOLWINDOW=128,$WS_EX_TOPMOST=8
Global $Time[7]
Dim $sd
Func Get_Date($IN)
Local $Ret=DllCall("kernel32.dll","int","GetCalendarInfo","int",$USER_DEFAULT, _
"int",$GREGORIAN, _
"int",$IN, _
"str",0, _
"int",10, _
"int",0)
Return $Ret[4]
EndFunc
Func Clock()
Local $T[7]
$AmPm=""
$pID=Run(@ComSpec&" /c time /t","",@SW_HIDE,3)
Do
$AmPm&=StdoutRead($pID)
Until @error
$T[0]=StringLeft($AmPm,1)
$T[1]=StringMid($AmPm,2,1)
$T[2]=StringLeft(@MIN,1)
$T[3]=StringRight(@MIN,1)
$T[4]=StringLeft(@SEC,1)
$T[5]=StringRight(@SEC,1)
$T[6]=StringRight(StringStripWS($AmPm,2),2)
For $I=5 To 0 Step -1
GUICtrlSetImage($Time[$I],$sd.Item($T[$I]))
Next
GUICtrlSetData($Time[6],$T[6])
EndFunc
$sd=ObjCreate("Scripting.Dictionary")
$sd.Add("0",@ScriptDir&"\0Led.gif")
$sd.Add("1",@ScriptDir&"\1Led.gif")
$sd.Add("2",@ScriptDir&"\2Led.gif")
$sd.Add("3",@ScriptDir&"\3Led.gif")
$sd.Add("4",@ScriptDir&"\4Led.gif")
$sd.Add("5",@ScriptDir&"\5Led.gif")
$sd.Add("6",@ScriptDir&"\6Led.gif")
$sd.Add("7",@ScriptDir&"\7Led.gif")
$sd.Add("8",@ScriptDir&"\8Led.gif")
$sd.Add("9",@ScriptDir&"\9Led.gif")
Global $Time[7]
Local $W=41,$H=79,$Green=0x00FF00
Local $Date=Get_Date($DAY_NAME+@WDAY)&", "&Get_Date($MONTH_NAME+@MON)&" "&@MDAY&", "&@YEAR
GUICreate("LED Clock - "&$Date,410,80,-1,-1,Default,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
GUISetBkColor(0)
$Time[0]=GUICtrlCreatePic($sd.Item("0"),0,0,$W,$H)
$Time[1]=GUICtrlCreatePic($sd.Item("0"),48,0,$W,$H)
GUICtrlCreateLabel(":",98,0,$W,$H)
GUICtrlSetFont(-1,46,800)
GUICtrlSetColor(-1,$Green)
$Time[2]=GUICtrlCreatePic($sd.Item("0"),128,0,$W,$H)
$Time[3]=GUICtrlCreatePic($sd.Item("0"),178,0,$W,$H)
GUICtrlCreateLabel(":",225,0,$W,$H)
GUICtrlSetFont(-1,46,800)
GUICtrlSetColor(-1,$Green)
$Time[4]=GUICtrlCreatePic($sd.Item("0"),255,0,$W,$H)
$Time[5]=GUICtrlCreatePic($sd.Item("0"),305,0,$W,$H)
$Time[6]=GUICtrlCreateLabel("",355,0,50,79)
GUICtrlSetFont(-1,26,800)
GUICtrlSetColor(-1,$Green)
GUISetState()
AdlibRegister("Clock",1000)
While GUIGetMsg()<>-3
WEnd
$sd=0```
发表评论
木有头像就木JJ啦!还木有头像吗?点这里申请属于你的个性Gravatar头像吧!