HockeyFan Posted July 20, 2005 Posted July 20, 2005 Can someone help me with a script that displays elapsed time?? I need this in a tooltip or splashtext showing Hour:Minutes:Seconds. A guess a Tooltip windows would be best becuase when I use sample scripts that use a SpashText box, I get a lot of flickering. This script will run during a long software installation to monitor how long the installation takes. :"> Thanks!!
seandisanti Posted July 20, 2005 Posted July 20, 2005 Can someone help me with a script that displays elapsed time?? I need this in a tooltip or splashtext showing Hour:Minutes:Seconds. A guess a Tooltip windows would be best becuase when I use sample scripts that use a SpashText box, I get a lot of flickering. This script will run during a long software installation to monitor how long the installation takes. :"> Thanks!! <{POST_SNAPBACK}>when i was first trying to get GUI's, i made a little stopwatch gui... code could probably use some cleaning up, but should suit your purpose...expandcollapse popup#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("STOPWATCH", 200, 100,-1,-1,-1,$WS_EX_TOPMOST) $ST = GUICtrlCreateButton("&Start/Stop",-1,50,100,50) $reset = GUICtrlCreateButton("&RESET",100,50,100,50) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlSetOnEvent($ST,"startstop") GUICtrlSetOnEvent($reset,"resetit") $MIN = 00 $SEC = 00 $HR = 00 $lbl = GUICtrlCreateLabel("0" & $HR & ":0" & $MIN & ":0" & $SEC,0,0,200,50,$SS_LEFTNOWORDWRAP) GUICtrlSetFont($lbl,30) GUISetState (@SW_SHOW) $i = 0 While 1 sleep(1000) if $i = 1 then if $sec = 59 then if $min = 59 then $hr = $hr + 1 $min = 00 $sec = 00 else $min = $min + 1 $sec = 00 endif else $sec = $sec + 1 endif if $hr < 10 and $min < 10 and $sec < 10 then GUICtrlSetData($lbl,"0" & $hr & ":0" & $min & ":0" & $sec) elseif $hr < 10 and $min < 10 then GUICtrlSetData($lbl,"0" & $hr & ":0" & $min & ":" & $sec) elseif $hr < 10 then GUICtrlSetData($lbl,"0" & $hr & ":" & $min & ":" & $sec) else GUICtrlSetData($lbl,$hr & ":" & $min & ":" & $sec) endif endif Wend Func startstop() if $i = 1 then $i = 0 else $i = 1 endif EndFunc Func resetit() $i = 0 $hr = 00 $min = 00 $sec = 00 GUICtrlSetData($lbl,"0" & $hr & ":0" & $min & ":0" & $sec) EndFunc Func CLOSEClicked() Exit EndFunc
HockeyFan Posted July 20, 2005 Author Posted July 20, 2005 Thanks... This is pretty much what I was hopeing for. I've cleaned it up by removing the Start/Stop & Reset buttons and changed it to a Toolwindow...now it serves the function that I needed. Thanks again!!
seandisanti Posted July 20, 2005 Posted July 20, 2005 Thanks... This is pretty much what I was hopeing for. I've cleaned it up by removing the Start/Stop & Reset buttons and changed it to a Toolwindow...now it serves the function that I needed.Thanks again!!<{POST_SNAPBACK}>no prob, glad i could help
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