Center display the current time at the top of the screen

Source: Internet
Author: User
Tags current time

Share a small script I often use: center the current time at the top of the screen, and you can move the mouse up to display the date, and press the left and right mouse button to open the script directory.

#NoEnv
#SingleInstance Force
coordmode, Mouse
menu, Tray, Click, 1
menu, Tray, Icon, Shell32.dll, 4
SetTimer, Show time,
Gosub, Show time
return

;--restart Script Hotkey
*ins::reload

display time:
time:=a_hour ":" A_min
if (!! = Oldtime )
{
  oldtime:=time
  Progress, b zh0 zy0 w130 y0 fm30 cwwhite,%time% winget
  , Timeid, Ahk_class Autoho Tkey2
  Winset, Transcolor, White, ahk_id%timeid%
}
mousegetpos, MX, my, Mid
if (Mid=timeid)
{
  if!open and Getkeystate ("Lbutton", "P") and
   getkeystate ("Rbutton", "P")
  {
    open:=1
    Run,%a_  scriptdir%
  }
  if (mx! = OLDMX or my! = oldmy)
  {
    oldmx:=mx, oldmy:=my
    day:=a_yyyy "year" a_mm "month" A_dd "Day Week"
     . SubStr ("Day 123456", a_wday,1)
    ToolTip, ' n  %day% ' n ' n  mouse key left and right press Open Directory  ' n ' t
  }
}
Else
{
  open:=0
  ToolTip
  ;--prevent other windows from vying for the most front-end display
  winset, Alwaysontop, ON, ahk_id%timeid%
}
Return

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.