ramseier Posted July 13, 2006 Share Posted July 13, 2006 This is a countdown to show when i can go home from work.expandcollapse popupOpt("WinTitleMatchMode", 2); Match substring Opt("TrayIconHide", 1) ;0=show, 1=hide tray icon #Include <date.au3> #include <GuiConstants.au3> GuiCreate("Startbutton Countdown", 253, 47,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Stunde = GuiCtrlCreateCombo("11", 52, 10, 50, 21) GUICtrlSetData(-1,"12|13|14|15|16|17|18|19|20|21|22|23|00","17") $Minute = GuiCtrlCreateCombo("00", 110, 10, 50, 21) GUICtrlSetData(-1,"05|10|15|20|25|30|35|40|45|50|55","30") $OK_Button = GuiCtrlCreateButton("OK", 170, 10, 70, 20) $Label_4 = GuiCtrlCreateLabel("Zielzeit:", 10, 13, 39, 20) GuiSetState() While 1 $msg = GuiGetMsg() $Label_4 = $msg Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $OK_Button ExitLoop Case Else ;; EndSelect WEnd GUISetState ( @SW_HIDE ) msgbox(0,"Confirm","Die gewünschte Zielzeit ist: "&GUICtrlRead(3)&":"&GUICtrlRead(4)) Global $Sec, $Min, $Hour, $Time Dim $iHours, $iMins, $iSecs $count=0 $set="Start" $EndTicks = _TimeToTicks(GUICtrlRead(3),GUICtrlRead(4),"00") While 1 $NowTicks = _TimeToTicks(@HOUR,@MIN,@SEC) $DifTicks = $EndTicks - $NowTicks if $EndTicks < $NowTicks then Exit _TicksToTime($DifTicks,$Hour,$Min,$Sec) if StringLen($Min)< 2 then $Min = "0" & $Min endif $Time = $Hour & ":" & $Min ControlSetText ( "", $set, 304, $Time ) ControlSetText ( "", "Start", 304, $Time ) $set = $Time Sleep(5000) ControlSetText ( "", $set, 304, "Start" ) Sleep(5000) Wend Link to comment Share on other sites More sharing options...
WTS Posted July 13, 2006 Share Posted July 13, 2006 thanks!! tis shall prove useful! Link to comment Share on other sites More sharing options...
w0uter Posted July 13, 2006 Share Posted July 13, 2006 (edited) I usually see those clock buttons and think about the countless of other times it has been done but this is verry original Edited July 13, 2006 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now