;; Select window by number ---------------------------------------------------- ;; -> body /* *#1::QuickLaunch(1) *#2::QuickLaunch(2) *#3::QuickLaunch(3) *#4::QuickLaunch(4) *#5::QuickLaunch(5) *#6::QuickLaunch(6) *#7::QuickLaunch(7) *#8::QuickLaunch(8) *#9::QuickLaunch(9) *#0::QuickLaunch(10) */ /* #1::Taskbar(1) #2::Taskbar(2) #3::Taskbar(3) #4::Taskbar(4) #5::Taskbar(5) #6::Taskbar(6) #7::Taskbar(7) #8::Taskbar(8) #9::Taskbar(9) #0::Taskbar(10) */ ; Shortcuts /* *#q::QuickLaunch(4) *#w::QuickLaunch(5) *#a::QuickLaunch(6) */ /* #q::Taskbar(4) #w::Taskbar(5) #a::Taskbar(6) */ /* #q:: hwnd := WinActive("A") WinGet, mm, MinMax, ahk_id %hwnd% WinGetPos, wx, wy, ww, wh, ahk_id %hwnd% MsgBox, %wx%x%wy% -- %ww%x%wh% if ((mm = 0) && (wx = 0) && (xy = 0) && (ww = A_ScreenWidth) && (wh = A_ScreenHeight)) WinActivate, ahk_class Progman return */ ;; -> library QuickLaunch(n) { static start := 56 ; set this to your start menu button width static width := 24 ; set this to your taskbar button width static offset := 0 ; don't change this if (offset = 0) offset := 15 else offset := 0 x := start + width*(n-1) + offset ; Activate taskbar if full-screen WinGetPos, wx, wy, ww, wh, A if (wx = 0 and wy = 0 and ww = A_ScreenWidth and wh = A_ScreenHeight) WinActivate, ahk_class Shell_TrayWnd ;DllCall("SwitchToThisWindow", "UInt", WinExist("ahk_class Progman"), "UInt", 1) tmp := A_CoordModeMouse CoordMode, Mouse, Screen MouseGetPos, ox, oy BlockInput, MouseMove MouseClick, Left, %x%, %A_ScreenHeight%, 1, 0 MouseMove, %ox%, %oy%, 0 BlockInput, MouseMoveOff CoordMode, Mouse, %tmp% } Taskbar(n) { static start := 63 ; set this to your start menu button width static width := 63 ; set this to your taskbar button width static offset := 0 ; don't change this if (offset = 0) offset := 15 else offset := 0 x := start + width*(n-1) + offset ; Activate taskbar if full-screen WinGetPos, wx, wy, ww, wh, A if (wx = 0 and wy = 0 and ww = A_ScreenWidth and wh = A_ScreenHeight) WinActivate, ahk_class Shell_TrayWnd ;DllCall("SwitchToThisWindow", "UInt", WinExist("ahk_class Progman"), "UInt", 1) tmp := A_CoordModeMouse CoordMode, Mouse, Screen MouseGetPos, ox, oy BlockInput, MouseMove MouseClick, Left, %x%, %A_ScreenHeight%, 1, 0 MouseMove, %ox%, %oy%, 0 BlockInput, MouseMoveOff CoordMode, Mouse, %tmp% }