; Scroll Sequentially Across Taskbar ; Source: http://www.autohotkey.com/forum/viewtopic.php?p=111795#111795 ; Original script by Lacrossa ; modified to include conditional scrolling (only when mouse is over Taskbar) ; in response to this request here ; http://www.donationcoder.com/Forums/bb/index.php?topic=13444.0 ; Mod for multi-monitor ; http://www.donationcoder.com/Forums/bb/index.php?topic=16715.0 #Persistent #SingleInstance,Force #NoEnv #WinActivateForce ;#NoTrayIcon DetectHiddenWindows, On ~WheelDown:: ;forward scroll--map to any key/button { MouseGetPos, , , id, control WinGetClass, class, ahk_id %id% If (class == "Shell_TrayWnd" || class == "aim_MultiMonitorTaskbar") ;If class = Shell_TrayWnd { i = 0 WinGet, active_id, ID, A WinGet, pid, PID, ahk_class %class% hProc := DllCall("OpenProcess", "Uint", 0x38, "int", 0, "Uint", pid) pRB := DllCall("VirtualAllocEx", "Uint", hProc, "Uint", 0, "Uint", 20, "Uint", 0x1000, "Uint", 0x4) VarSetCapacity(btn, 20) VarSetCapacity(nfo, 24) SendMessage, 0x418, 0, 0, ToolbarWindow322, ahk_class %class% Loop, %ErrorLevel% { SendMessage, 0x417, A_Index - 1, pRB, ToolbarWindow322, ahk_class %class% DllCall("ReadProcessMemory", "Uint", hProc, "Uint", pRB, "Uint", &btn, "Uint", 20, "Uint", 0) dwData := DecodeInteger(&btn +12) DllCall("ReadProcessMemory", "Uint", hProc, "Uint", dwData, "Uint", &nfo, "Uint", 24, "Uint", 0) hWnd := DecodeInteger(&nfo + 0) if hWnd = 0 Continue i++ active_hWnd%i% := hWnd SetFormat, integer, h active_hWnd%i% += 0 test_Handle := active_hWnd%i% SetFormat, integer, d %i% += 0 if test_Handle = %active_id% { currentHandleIndex := i } } DllCall("VirtualFreeEx", "Uint", hProc, "Uint", pRB, "Uint", 0, "Uint", 0x8000) DllCall("CloseHandle", "Uint", hProc) desiredHandleIndex := currentHandleIndex + 1 if desiredHandleIndex > %i% { desiredHandleIndex := 1 } next_hWnd := active_hWnd%desiredHandleIndex% WinActivate ahk_id %next_hWnd% } } return ~WheelUp:: ;backward scroll--map to any key/button { MouseGetPos, , , id, control WinGetClass, class, ahk_id %id% If (class == "Shell_TrayWnd" || class == "aim_MultiMonitorTaskbar") ;If class = Shell_TrayWnd { i = 0 WinGet, active_id, ID, A WinGet, pid, PID, ahk_class %class% hProc := DllCall("OpenProcess", "Uint", 0x38, "int", 0, "Uint", pid) pRB := DllCall("VirtualAllocEx", "Uint", hProc, "Uint", 0, "Uint", 20, "Uint", 0x1000, "Uint", 0x4) VarSetCapacity(btn, 20) VarSetCapacity(nfo, 24) SendMessage, 0x418, 0, 0, ToolbarWindow322, ahk_class %class% Loop, %ErrorLevel% { SendMessage, 0x417, A_Index - 1, pRB, ToolbarWindow322, ahk_class %class% DllCall("ReadProcessMemory", "Uint", hProc, "Uint", pRB, "Uint", &btn, "Uint", 20, "Uint", 0) dwData := DecodeInteger(&btn +12) DllCall("ReadProcessMemory", "Uint", hProc, "Uint", dwData, "Uint", &nfo, "Uint", 24, "Uint", 0) hWnd := DecodeInteger(&nfo + 0) if hWnd = 0 Continue i++ active_hWnd%i% := hWnd SetFormat, integer, h active_hWnd%i% += 0 test_Handle := active_hWnd%i% SetFormat, integer, d %i% += 0 if test_Handle = %active_id% { currentHandleIndex := i } } DllCall("VirtualFreeEx", "Uint", hProc, "Uint", pRB, "Uint", 0, "Uint", 0x8000) DllCall("CloseHandle", "Uint", hProc) desiredHandleIndex := currentHandleIndex - 1 if desiredHandleIndex < 1 { desiredHandleIndex = %i% } next_hWnd := active_hWnd%desiredHandleIndex% WinActivate ahk_id %next_hWnd% } } return DecodeInteger(ptr) { Return *ptr | *++ptr << 8 | *++ptr << 16 | *++ptr << 24 }