当我从 Windows 10 降级到 Windows 7 后,AutoHotkey 脚本停止工作:
- 脚本通过快捷方式Ctrl++启动ShiftL
- 监视器ESC仅通过以下方式唤醒,但如果我取消注释则不会唤醒
DllCall("LockWorkStation")
:#NoEnv ; # Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; # Enable warnings to assist with detecting common errors. SendMode Input ; # Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; # Ensures a consistent starting directory. ;^!l:: Run C:\Users\root\Desktop\Погасить_экран\TCIMG.exe monof=2||({SPACE}, {ESC}, {F9}) Loop { Sleep, 200 ; pause ; DllCall("LockWorkStation") Sleep, 200 ; pause SendMessage, 0x112, 0xF170, 2,, Program Manager ; # 0x112 is WM_SYSCOMMAND, 0xF170 is SC_MONITORPOWER. } ~ESC:: ; ESC - stop script SendMessage, 0x112, 0xF170, -1,, Program Manager ; # turn on monitor ExitApp ; exit Return ;