aboutsummaryrefslogtreecommitdiff
path: root/scripts.ahk
blob: de1fd0bc862ba749be860dcde4c03fa8cd9ff7e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#Include ../lib/Acc.ahk

; Directives ------------------------------------------------------------------

<<directives>>

#SingleInstance Force
#Persistent
#NoEnv
#WinActivateForce
#MaxHotkeysPerInterval 200

; Initialization --------------------------------------------------------------

WindowMessageHandlers := []

<<init>>

Gui +LastFound
DllCall("RegisterShellHookWindow", UInt, WinExist())
msg := DllCall("RegisterWindowMessage", Str, "SHELLHOOK")
OnMessage(msg, "WindowMessage")
return

; Body ------------------------------------------------------------------------

<<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

; 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

; Library ---------------------------------------------------------------------

<<library>>

WindowMessage(wParam, lParam)
{
  global WindowMessageHandlers
  for k, v in WindowMessageHandlers
  {
    %v%(wParam, lParam)
  }
}