#Persistent
#SingleInstance force
time := 10
TrayTip, Power, 在 %time% 秒后进入睡眠状态, 5, 18
SetTimer, UpdateOSD, 1000
Return
UpdateOSD:
if (time < 5 AND A_TimeIdle < 5000) {
ExitApp
} else if (time < 1) {
;MsgBox,0,Warning,Windows will now go to sleep,3
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
ExitApp
} else if (time = 5) {
TrayTip, Power, 在 %time% 秒后进入睡眠状态, 5, 18
}
time-=1
Return
声明:站内资源为整理优化好的代码上传分享与学习研究,如果是开源代码基本都会标明出处,方便大家扩展学习路径。请不要恶意搬运,破坏站长辛苦整理维护的劳动成果。本站为爱好者分享站点,所有内容不作为商业行为。如若本站上传内容侵犯了原著者的合法权益,请联系我们进行删除下架。

评论(0)