Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Tray clock with seconds (or some other info)


  • Please log in to reply
2 replies to this topic
Landvermesser
  • Members
  • 51 posts
  • Last active: Aug 12 2008 09:02 AM
  • Joined: 03 Nov 2004
This short script shows how to add some info to Windows tray clock (here -- seconds, but may be the CPU usage be usefull too)

#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


evl
  • Members
  • 1237 posts
  • Last active: Oct 20 2010 11:41 AM
  • Joined: 24 Aug 2005
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.

Landvermesser
  • Members
  • 51 posts
  • Last active: Aug 12 2008 09:02 AM
  • Joined: 03 Nov 2004
It is correct, I have made precisely it in the project MacClock. Look here: http://landvermesser...m/MacClock.html (it's not a spam!-)