Please check the examples below.
Why is example #2 failing (when using Firefox) and how can I correct the error?
Example #1 - works when global variant is disabled
Code: Select all
GroupAdd "HorizontalScroll1", "ahk_class MozillaWindowClass" ; Firefox
GroupAdd "HorizontalScroll1", "ahk_class other" ; other
#HotIf WinActive("ahk_group HorizontalScroll1")
+WheelUp::WheelLeft
+WheelDown::WheelRight
#HotIf
/* global variant disabled
+WheelUp::SendMessage 0x0114, 0, 0, ControlGetFocus("A") ; scroll left - 0x114 is WM_HSCROLL, 0 is SB_LINERIGHT
+WheelDown::SendMessage 0x0114, 1, 0, ControlGetFocus("A") ; scroll right - 1 is SB_LINELEFT
*/
ListLines output -
Spoiler
Example #2 - fails when global variant enabled
Code: Select all
GroupAdd "HorizontalScroll1", "ahk_class MozillaWindowClass" ; Firefox
GroupAdd "HorizontalScroll1", "ahk_class other" ; other
#HotIf WinActive("ahk_group HorizontalScroll1")
+WheelUp::WheelLeft
+WheelDown::WheelRight
#HotIf
+WheelUp::SendMessage 0x0114, 0, 0, ControlGetFocus("A") ; scroll left - 0x114 is WM_HSCROLL, 0 is SB_LINERIGHT
+WheelDown::SendMessage 0x0114, 1, 0, ControlGetFocus("A") ; scroll right - 1 is SB_LINELEFT
Listlines output -
Spoiler
Error pop-up -
Spoiler