Skip to content

Instantly share code, notes, and snippets.

@longtth
Created January 2, 2017 09:37
Show Gist options
  • Save longtth/3b115992a78b822d67d6cc2e715e5e4d to your computer and use it in GitHub Desktop.
Save longtth/3b115992a78b822d67d6cc2e715e5e4d to your computer and use it in GitHub Desktop.
Cuộn ngang
#IfWinActive, ahk_class ahk_class XLMAIN
LShift & WheelUp::ComObjActive("Excel.Application").ActiveWindow.SmallScroll(0,0,0,1) ; Scroll left.
LShift & WheelDown::ComObjActive("Excel.Application").ActiveWindow.SmallScroll(0,0,1) ; Scroll right.
#IfWinActive
~LShift & WheelUp:: ; Scroll left.
ControlGetFocus, fcontrol, A
Loop 2 ; <-- Increase this value to scroll faster.
SendMessage, 0x114, 0, 0, %fcontrol%, A ; 0x114 is WM_HSCROLL and the 0 after it is SB_LINERIGHT.
return
~LShift & WheelDown:: ; Scroll right.
ControlGetFocus, fcontrol, A
Loop 2 ; <-- Increase this value to scroll faster.
SendMessage, 0x114, 1, 0, %fcontrol%, A ; 0x114 is WM_HSCROLL and the 1 after it is SB_LINELEFT.
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment