Advertisement
Guest User

PHD Example

a guest
Dec 8th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.22 KB | None | 0 0
  1. #include <Constants.au3>
  2. #include <GUIConstantsEx.au3>
  3. #Region ### START Koda GUI section ### Form=
  4. $Form1 = GUICreate("AForm1", 122, 42, 438, 156)
  5. $Label1 = GUICtrlCreateLabel("15:00", 8, 8, 43, 17)
  6. $label_tray = GUICtrlCreateLabel("Hide TrayTip", 8, 28, 70, 17)
  7.     GUICtrlSetFont($label_tray,8.5,400,4)
  8.     GUICtrlSetCursor($label_tray,0)
  9. GUISetState(@SW_SHOW)
  10. #EndRegion ### END Koda GUI section ###
  11. Local $k = 0, $ShowTrayTip = True
  12. $time=TimerInit()
  13. While 1
  14.     $nMsg = GUIGetMsg()
  15.     Switch $nMsg
  16.         Case -3
  17.             Exit
  18.         Case $label_tray
  19.             If $ShowTrayTip = True Then
  20.                 GUICtrlSetData($label_tray,"Show TrayTip")
  21.                 $ShowTrayTip = False
  22.             Else
  23.                 GUICtrlSetData($label_tray,"Hide TrayTip")
  24.                 $ShowTrayTip = True
  25.             EndIf
  26.     EndSwitch
  27.     If TrayGetMsg() = $TRAY_EVENT_PRIMARYDOWN Then MsgBox(0,0,0)
  28.     $snew = TimerDiff ($time)
  29.     If $k <> Int($snew/1000) Then
  30.         $new = (15*60*1000)-$snew
  31.         $seconds = Round ($new/1000)
  32.         $newMin = Floor ($seconds/60)
  33.         $newSec = Mod ($seconds, 60)
  34.         If $newSec < 10 Then $newSec = "0"&$newSec
  35.         GUICtrlSetData ($Label1, $newMin&":"&$newSec)
  36.         $k =  Int($snew/1000)
  37.         TraySetToolTip ($newMin&":"&$newSec)
  38.         If $ShowTrayTip Then TrayTip("CountDown",$newMin&":"&$newSec,1)
  39.     EndIf
  40. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement