Jump to content

Clock


Recommended Posts

The label blinks a bit, but keep in mind this was built in less than 5 minutes

PM hasn't been implemented...

#include <GUIConstants.au3>
#include <Constants.au3>
#include <misc.au3>
;=====================================================================
; The cheapest crappiest clock by Eynstyne
;=====================================================================
opt("TrayMenumode",1)
$Form1 = GUICreate("Clock", 154, 54, @desktopwidth - 163, @desktopheight - 100, -1, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)
$font = _choosefont()

if not isarray($font) then
exit
endif
 
GUISetBkColor(0x000000)
$clock = GUICtrlCreateLabel("", 7, 15, 154, 36)
GUICtrlSetFont(-1, $font[3], $font[4], $font[1], $font[2]);<-- Just get some LCD font or something
GUICtrlSetColor(-1, $font[7])
GUICtrlSetBkColor(-1, 0x000000)
$fontc = Traycreateitem("&Choose Font")
$exit = traycreateitem("&Exit")
GUISetState(@SW_SHOW)
traysetstate()
$ampm = ""
While 1
$msg = GuiGetMsg()
            $t = traygetmsg()
select
case $t = $exit
exit
case $t = $fontc
$font = _choosefont()

if not isarray($font) then
continueloop
endif
 
GUICtrlSetFont(-1, $font[3], $font[4], $font[1], $font[2]);<-- Just get some LCD font or something
GUICtrlSetColor(-1, $font[7])


    Case $msg = $GUI_EVENT_CLOSE
        Exit

    EndSelect
time()
wend

func time()

    sleep(20)
        if @hour = 12 then
            $hour = @hour - 0
             $ampm = "Pm"
            elseif @hour = 0 then
         $hour = 12
$ampm = "Am"
     elseif @hour > 12 then
      $ampm = "Pm"
    $hour = @hour - 12
    Elseif @hour < 12 then
      $ampm = "Am"
    $hour = @hour - 0
             elseif @hour > 9 then
               $hour = @hour - 0
             elseif @hour < 9 then
              $hour = @hour - 0
    EndIf
 guictrlsetdata($clock, $hour & ":" & @MIN & ":" & @SEC & $ampm)
 winsettitle("Clock","","Clock - " & $hour & ":" & @MIN & ":" & @SEC & $ampm)
 TraySetTooltip($hour & ":" & @MIN & ":" & @SEC & $ampm)
endfunc
Edited by eynstyne
F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...