#Include ../lib/Acc.ahk ; Directives ------------------------------------------------------------------ <> #SingleInstance Force #Persistent #NoEnv #WinActivateForce #MaxHotkeysPerInterval 200 ; Initialization -------------------------------------------------------------- WindowMessageHandlers := [] <> Gui +LastFound DllCall("RegisterShellHookWindow", UInt, WinExist()) msg := DllCall("RegisterWindowMessage", Str, "SHELLHOOK") OnMessage(msg, "WindowMessage") return ; Body ------------------------------------------------------------------------ <> ; Miscellaneous #Space::CapsLock #PrintScreen::Media_Prev #ScrollLock::Media_Play_Pause #Pause::Media_Next #e::Run, % "explorer /n, ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" #!t::WinSet, AlwaysOnTop,, ahk_class tooltips_class32 ; fix bug ; Set default web browser #^d:: Run, reg import "%A_ScriptDir%\chrome.reg",, Hide DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0) return #!d:: Run, reg import "%A_ScriptDir%\mypal.reg",, Hide DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0) return ; Sleep ^+F12 Up:: Sleep, 600 DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0) return +F12 Up:: Sleep, 600 SendMessage,0x112,0xF170,2,,Program Manager ; turn off monitor return ^F12 Up:: Sleep, 600 Run, %A_WinDir%\system32\ssstars.scr /s ; start screen saver return ; Library --------------------------------------------------------------------- <> WindowMessage(wParam, lParam) { global WindowMessageHandlers for k, v in WindowMessageHandlers { %v%(wParam, lParam) } }