How to set desktop time in AutoHotkey-AutoHotkey tutorial

Time: 2020-12-05Source: Huajun Software TutorialAuthor: Aotuman

Are you familiar with the AutoHotkey software? Do you know how to set the desktop time in AutoHotkey? So today I will share with you how to set the desktop time in AutoHotkey. Friends in need can read this article. I hope it can help. Dear friends.

First, download and install AutoHotkey on your computer. After installation, create a new folder on the disk outside the C drive to store the desktop time program. Here, take the example of creating a new folder named clock under the Program Files folder under the D drive. As shown in the picture

How to set desktop time with AutoHotkey

Under the clock folder, right-click the mouse and create a new AutoHotkey Script.ahk file. After AutoHotkey is successfully installed, right-click the mouse and click New to create a new AutoHotkey Script project. As shown in the picture

How to set desktop time with AutoHotkey

Name the new AutoHotkey Script.ahk clock.ahk. As shown in the picture

How to set desktop time with AutoHotkey

Select clock.ahk, right-click and select Edit Script to edit the clock.ahk file. As shown in the picture

How to set desktop time with AutoHotkey

Delete the code in clock.ahk, copy the following code, and paste it into clock.ahk:

#NoTrayIcon

;

; 24 hours a day, 1440 minutes, 86400 seconds

;A week is 168 hours, 10080 minutes, 604800 seconds

;30 days 750 hours, 43200 minutes, 2592000 seconds

;365 days, 8760 hours, 525600 minutes, 31536000 seconds

CustomColor=ff3301

Gui, +AlwaysOnTop +LastFound +Owner

Gui, Color, %CustomColor%

gui, font, Arial

gui, font, s30

Gui, Add, Text, vMyText cff3300, w600 XXXXX YYYYY

WinSet, TransColor, %CustomColor% 255

Gui, -Caption

SetTimer,UpdateOSD,1000

Gosub,UpdateOSD

Gui, Show, x860 y690;

UpdateOSD:

time=%A_MM%month%A_DD%day

time2=%A_Hour%:%A_Min%:%A_Sec%

GuiControl,MyText,%time%,%time2%

F10::

msgbox,4100,Exit successfully, you have exited time!,1

exitapp

return

--------------------------Copy the above code.

Refer to the picture, where ① and ② are the time font color code and edge color code, which can be changed as you like.

③ is the coordinate position of the time interface, which can be changed according to the screen.

④ is the shortcut key to exit the time. Here it is set to press F10 to exit this time program.

As shown in the picture

How to set desktop time with AutoHotkey
How to set desktop time with AutoHotkey

Save the clock.ahk document, select it, right-click and select Compile Script. A clock.exe executable file will be generated in the folder. This is the encapsulated time program. As shown in the picture

How to set desktop time with AutoHotkey

Double-click the clock.exe file and it will be running in the background. At this time, the desktop will display a dynamic time with date. If you need to exit, press F10 to exit. As shown in the picture

How to set desktop time with AutoHotkey

Of course, if you want to start it at boot, you can also set the executable file to be displayed on the desktop at boot time, without having to start it manually every time.

The above is the method shared by the editor to set the desktop time in AutoHotkey. Friends who don’t know how to do it should hurry up and learn it.

Related articles更多>>

Popular recommendations