/* AutoHotKey script to Click top arrow and/or bottom arrow of a specific scroll bar in DAS Trader Pro Montage */ #SingleInstance Force #InstallMouseHook #NoTrayIcon #MaxHotkeysPerInterval 200 SetTitleMatchMode,2 #IfWinActive, ahk_exe DasTrader.exe ~WheelDown:: ; User clicks in window then scrolls with mouse wheel. ControlGetFocus, OutputVar, A ; Get Control of current selected Window If (OutputVar = "Edit2") { ControlFocus, ScrollBar1, A ; Focus on the scroll bar of selected window ControlGetPos, x, y, w, h, ScrollBar1, A ; Get size and coordinates on the scroll bar xVar := x + 5 ; Calculate absolute location of bottom arrow button of scroll bar - set X ...center of the button yVar := y + h - 5 ; Calculate absolute location of bottom arrow button of scroll bar - set Y xVarRel := 5 ; Calculate relative location of bottom arrow button of scroll bar - set X ...center of the button yVarRel := h - 2 ; Calculate relative location of bottom arrow button of scroll bar - set Y SetControlDelay -1 ControlClick, ScrollBar1, A, , Left, 1, NA X%xVarRel% Y%yVarRel% ToolTip, Scrolling Down... ; Display at mouse arrow ControlClick, Edit2, A ; Select the Control/window before exiting SetTimer, ToolTipLabel, 1500 } return ~WheelUp:: ; User clicks in window then scrolls with mouse wheel. ControlGetFocus, OutputVar, A If (OutputVar = "Edit2") { ControlFocus, ScrollBar1, A ; Focus on the scroll bar of selected window ControlGetPos, x, y, w, h, ScrollBar1, A ; Get size and coordinates on the scroll bar xVar := x + 5 ; Calculate absolute location of top arrow button of scroll bar - set X ...center of the button yVar := y + 5 ; Calculate absolute location of top arrow button of scroll bar - set Y xVarRel := 5 ; Calculate relative location of bottom arrow button of scroll bar - set X ...center of the button yVarRel := 5 ; Calculate relative location of bottom arrow button of scroll bar - set Y SetControlDelay -1 ControlClick, ScrollBar1, A, , Left, 1, NA X%xVarRel% Y%yVarRel% ToolTip, Scrolling Up... ; Display at mouse arrow ControlClick, Edit2, A ; Select the Control/window before exiting SetTimer, ToolTipLabel, 1500 } return ToolTipLabel: ToolTip, SetTimer, ToolTipLabel, off return #IfWinActive return ; End