倒计时关机

/*
Name:倒计时关机
Version:1.0
Author:lyuchen
E-mail:lyuchen@sohu.com
*/

#Persistent
#SingleInstance,Force

SplitPath, A_AhkPath, ,Dir,
Menu Tray, Icon, %Dir%ScriptsResource倒计时关机.ico,,1

Gui, Margin, 5, 5
Gui, Font, S10
Gui, +AlwaysOnTop -MaximizeBox -MinimizeBox
Gui, Add, Radio, checked vMyRadio, Count 
Gui, Add, Radio, x+25, Alarm
Gui, Add, Edit, x5 w65 h25 +0x2000 +Center vH -Limit, 00
Gui, Add, Text, x+3 w10 h25 +Center, :
Gui, Add, Edit, x+3 w65 h25 +0x2000 +Center vM -Limit, 00
Gui, Add, Button, x5 y+5 w70 h25 Default, OK
Gui, Add, Button, x+6 w70 h25 , Cancel
Gui, Show, AutoSize Center, 倒计时关机

OnExit Tray_Exit
Goto, Menu_Show
Return
GuiClose:
ButtonCancel:
ExitApp
Return
ButtonOK:
Gui,Submit
time_s = %A_TickCount%
If MyRadio = 1
	time := H*3600000+M*60000
Else
	time := (H-A_Hour)*3600000+(M-A_Min)*60000
time_a += time/1000, Sec
FormatTime, time_c, %time_a%,HH:mm
Menu, Tray, Tip, 倒计时关机 %time_c%
Sleep, %time%
Run, %A_WinDir%system32shutdown.exe -s -f,,Hide
Sleep, 180000
Shutdown, 5
Return
GuiEscape:
Tray_Exit:
If A_ExitReason not in Logoff,Shutdown
{
Run %A_WinDir%system32shutdown.exe -a,,Hide
}
ExitApp
Return
Menu_Show:
{
Menu, Tray, NoStandard
Menu, Tray, Click, 1
Menu, Tray, Tip, 倒计时关机
Menu, Tray, Add, 倒计时关机, Tray_Show
Menu, Tray, ToggleEnable, 倒计时关机
Menu, Tray, Default, 倒计时关机
Menu, Tray, Add
Menu, Tray, Add, 时间(&S), Tray_Time
Menu, Tray, Add
Menu, Tray, Add, 重启(&R), Tray_Reload
Menu, Tray, Add, 退出(&X), Tray_Exit
}
Return
Tray_Show:
Menu, Tray, Show
return
Tray_Reload:
Reload
Return
Tray_Time:
FormatTime, time_b, %time_a%,MM月dd日HH时mm分
miao:=(time-(A_TickCount-time_s))//1000, dd:=miao//86400, hh:=Mod(miao,86400)//3600, mm:=Mod(Mod(miao,86400),3600)//60, ss:=Mod(Mod(Mod(miao,86400),3600),60)
If hh < 10
	hh :=0 hh
If mm < 10
	mm :=0 mm
If ss < 10
	ss :=0 ss
MsgBox, 262192, 倒计时关机, 剩余:`n%dd%天%hh%时%mm%分%ss%秒`n到时:`n%time_b%
Return

给TA捐赠
共{{data.count}}人
人已捐赠
其他

!优蛋

2020-3-19 18:28:52

其他

!北京时间

2020-3-19 18:42:47

个人中心
购物车
优惠劵
有新私信 私信列表
搜索