AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tray clock with seconds (or some other info)

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Landvermesser



Joined: 03 Nov 2004
Posts: 51

PostPosted: Mon Mar 13, 2006 9:41 am    Post subject: Tray clock with seconds (or some other info) Reply with quote

This short script shows how to add some info to Windows tray clock (here -- seconds, but may be the CPU usage be usefull too)

Code:
#Persistent
RegRead, SavedTimeFormat, HKEY_CURRENT_USER, Control Panel\International, sTimeFormat
OnExit, SubExit
SetTimer, WatchTime, 1000
Return

WatchTime:
   RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\International, sTimeFormat, '       'H:mm':%A_Sec%       '
   SendMessage, 0x1A, 0, "intl", TrayClockWClass1, ahk_class Shell_TrayWnd
   Return
   
SubExit:
   RegWrite, REG_SZ, HKEY_CURRENT_USER, Control Panel\International, sTimeFormat, %SavedTimeFormat%
   SendMessage, 0x1A, 0, "intl", TrayClockWClass1, ahk_class Shell_TrayWnd
   ExitApp

_________________
My AHK project: http://landvermesser.tripod.com/
Back to top
View user's profile Send private message Visit poster's website
evl



Joined: 24 Aug 2005
Posts: 1239

PostPosted: Mon Mar 13, 2006 12:32 pm    Post subject: Reply with quote

Interesting idea - I'm not sure if there are any drawbacks to writing to the registry every second (does anyone know when windows actually saves the registry to the hard disk? Only when shutting down?).

You could make a fancier solution by making the clock a little wider by changing its text as you showed and then covering it with the Start Button Clock + cpu and memory usage (mod of Laszlo's) I modded. You only need to change the X_Pos to suit your resolution and maybe the height of the clock/bars to fit your windows' theme.
Back to top
View user's profile Send private message
Landvermesser



Joined: 03 Nov 2004
Posts: 51

PostPosted: Tue Mar 14, 2006 6:42 am    Post subject: Reply with quote

It is correct, I have made precisely it in the project MacClock. Look here: http://landvermesser.tripod.com/MacClock.html (it's not a spam!-)
_________________
My AHK project: http://landvermesser.tripod.com/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group