autohotkey倒关机

倒计时关机


#Persistent
#SingleInstance,force
Gui, Margin, 5, 5
Gui, Font, S12
Gui, +AlwaysOnTop -MaximizeBox -MinimizeBox
Gui, Add, Edit, w50 h20 +0x2000 +Center vH -Limit, 00
Gui, Add, Text, x+2 w10 h20 +Center, :
Gui, Add, Edit, x+2 w50 h20 +0x2000 +Center vM -Limit, 00
Gui, Add, Button, x+5 w60 h20 Default, &OK
Gui, Show, auto, 倒计时关机
OnExit Cencel
Goto, Menu_Show
return
GuiClose:
ExitApp
Return
ButtonOK:
Gui,Submit
time_s = %A_TickCount%
time := H*3600000+M*60000
time_a += time/1000, Sec
Sleep, %time%
Run, %A_WinDir%\system32\shutdown.exe -s -f,,Hide
Sleep, 180000
Shutdown, 5
Return
GuiEscape:
Cencel:
if A_ExitReason not in Logoff,Shutdown
{
Run %A_WinDir%\system32\shutdown.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), Cencel
}
Return
Tray_Show:
Menu, Tray, Show
return
Tray_Reload:
Reload
Return
Tray_Time:
time_e := Ceil((time-(A_TickCount-time_s))/60000)
FormatTime, time_b, %time_a%,MM月dd日`nHH时mm分
msgbox, 262192, 倒计时关机, %time_b%`n剩余 %time_e% 分钟
return


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值