本帖最后由 love5173 于 2012-1-21 15:20 编辑
回复 6# tcpuuu
写的比较粗糙,这个函数我也不怎么用,用的时候发现不怎么好用,不知道是不是不会用的原因
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=..\..\789798789.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include "CoProc.au3"
GUICreate('TIME',400,560)
Global $TIM7,$gi_CoProcParentli
;--------------------------------------------------------------------------------------------------
$TIM1 = GUICtrlCreateLabel("",1,502,86,18)
GUICtrlSetData($TIM1,'今天是' & @YEAR);---------擷取今年日期
$TIM2 = GUICtrlCreateLabel("-",88,500,8,22)
$TIM3= GUICtrlCreateLabel("",100,502,16,18)
GUICtrlSetData($TIM3,@MON);---------擷取月日期
$TIM4 = GUICtrlCreateLabel("-",118,500,8,22)
$TIM5= GUICtrlCreateLabel("",128,502,16,18)
GUICtrlSetData($TIM5,@MDAY);---------擷取日期
$TIM6= GUICtrlCreateLabel("",148,502,48,18)
GUICtrlSetData($TIM6,@WDAY);---------擷取星期
Select
Case GUICtrlRead($TIM6) = 1
GUICtrlSetData($TIM6,'星期日')
GUICtrlSetColor ($TIM6,0xFF0000)
Case GUICtrlRead($TIM6) = 2
GUICtrlSetData($TIM6,'星期一')
Case GUICtrlRead($TIM6) = 3
GUICtrlSetData($TIM6,'星期二')
Case GUICtrlRead($TIM6) = 4
GUICtrlSetData($TIM6,'星期三')
Case GUICtrlRead($TIM6) = 5
GUICtrlSetData($TIM6,'星期四')
Case GUICtrlRead($TIM6) = 6
GUICtrlSetData($TIM6,'星期五')
Case GUICtrlRead($TIM6) = 7
GUICtrlSetData($TIM6,'星期六')
GUICtrlSetColor ($TIM6,0x008000)
EndSelect
$TIM7 = GUICtrlCreateLabel("",200,502,100,16,0x01)
GUICtrlSetData($TIM7,@HOUR & ":" & @MIN & ":" & @SEC)
$ch=_CoProc("updata")
For $i = $TIM1 to $TIM7
GUICtrlSetFont($i,12)
Next
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
Exit
EndSwitch
WEnd
Func updata()
While 1
If Not WinExists("TIME","") Then Exit
ControlSetText("TIME","","Static7",@HOUR & ":" & @MIN & ":" & @SEC)
WEnd
EndFunc
|