^XButton2:: Send "{Volume_Up}"
^XButton1:: Send "{Volume_Down}"
^Ins:: SetVolume("Up")
^Del:: SetVolume("Down")
^PrintScreen:: SetVolume("Mute")
SetVolume(LPARAM) {
static WM_APPCOMMAND := 0x319
static APPCOMMAND_VOLUME_MUTE := 0x80000
static APPCOMMAND_VOLUME_UP := 0xA0000
static APPCOMMAND_VOLUME_DOWN := 0x90000
switch LPARAM {
case "Up": APPCOMMAND_VOLUME_TYPE := APPCOMMAND_VOLUME_UP
case "Down": APPCOMMAND_VOLUME_TYPE := APPCOMMAND_VOLUME_DOWN
case "Mute": APPCOMMAND_VOLUME_TYPE := APPCOMMAND_VOLUME_MUTE
}
HWorkerW := WinGetID("ahk_class WorkerW")
DllCall("SendMessage", "UInt", HWorkerW, "UInt", WM_APPCOMMAND, "UInt", 0, "UInt", APPCOMMAND_VOLUME_TYPE)
}