Jump to content
Sign in to follow this  
Rahul Rohela

To diaply time...Change with relatime clock

Recommended Posts

Please post script to display time On GUI window. Dispaly should change with PC Clock.

I mean to say SHow time with changing Minutes & seconds.

Here is one I found in Scripts and Scraps a while back. I cant remember who wrote it.

#include <GuiConstants.au3>
Global $sec = @SEC, $minute, $hour, $light, $time, $clocklabel
opt("WinWaitDelay", 100)
opt("WinTitleMatchMode", 4)
opt("WinDetectHiddenText", 1)
opt("MouseCoordMode", 0)
GUICreate("Max's Clock", 200, 50, (@DesktopWidth - 188) / 2, (@DesktopHeight - 59) / 2)
$clocklabel = GUICtrlCreateLabel("Loading...", 5, 5, 190, 40, 0x1000)
GUICtrlSetFont($clocklabel, 24)
While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then
    ElseIf $sec <> @SEC Then
        GUICtrlSetData($clocklabel, TimeSet())
Func AlarmCheck($time)
If $time = "9:00:00 PM"Then
MsgBox(0,"","Time to call it a night");Alarm function(configure how wanted)
EndFunc ;==>AlarmCheck
Func TimeSet()
    $light = " AM"
    $hour = @HOUR
    $minute = @MIN
    $sec = @SEC
    If $hour = 0 Then
        $hour = 12
    ElseIf $hour = 12 Then
        $light = " PM"
    ElseIf $hour > 12 Then
        $hour = (@HOUR) - 12
        $light = " PM"
    $time = $hour & ":" & $minute & ":" & $sec & $light
    Return $time
EndFunc ;==>TimeSet

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...