- Code:
; Win+F12 - Sleep
#F12::
; Sleep/Suspend:
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
; Hibernate:
;DllCall("PowrProf\SetSuspendState", "int", 1, "int", 0, "int", 0)
Return
; Win+Shift+F12 - Lock and sleep
#+F12::
; Lock:
Run rundll32.exe user32.dll`,LockWorkStation
Sleep 1000
; Sleep/Suspend:
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
; Hibernate:
;DllCall("PowrProf\SetSuspendState", "int", 1, "int", 0, "int", 0)
Return
Nguồn:
- Code:
https://gist.githubusercontent.com/davejamesmiller/1965847/raw/aeb0ab48d20e8bb4dfd300e429feda379059fdde/sleep.ahk