这样效率会好点
#include <StaticConstants.au3>
Global $S
$Form1 = GUICreate('AU3 Good!!', 500, 400, -1, -1, $WS_POPUP)
GUISetBkColor(0x999999)
GUISetFont(11, 400, 0, 'Verdana')
$Label1 = GUICtrlCreateLabel(' AU3 Good!!', 0, 0, 460, 40, $SS_CENTERIMAGE, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0x666666)
GUICtrlSetColor(-1, 0xEFEFEF)
$Label2 = GUICtrlCreateLabel('×', 460, 0, 40, 40, $SS_CENTER)
GUICtrlSetBkColor(-1, 0x666666)
GUICtrlSetColor(-1, 0xEFEFEF)
GUICtrlSetFont(-1, 20, 400, 0, 'Verdana')
GUISetState(@SW_SHOW)
While 1
$info = GUIGetCursorInfo()
Switch $info[4]
Case $Label2
If $S = True Then
GUICtrlSetColor($Label2, 0xFF0000)
$S = False
EndIf
Case Else
If $S = False Then
GUICtrlSetColor($Label2, 0xFFFFFF)
$S = True
EndIf
EndSwitch
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Label2
Exit
EndSwitch
WEnd
|