Zend certified PHP/Magento developer

Focus a window under the mouse and send a hotkey

When pressing “Ctrl + WheelUp/Down” with the pointer under Chrome I would like to focus the Chrome window once and then send the ^+tab hotkey as shown in my code:

Ctrl & WheelUp::
MouseGetPos,,, WinUMID
WinGetClass, class, ahk_id %WinUMID%

if (InStr(class,"Chrome_WidgetWin_1")) {
send, {Ctrl down}{Shift down}{tab}
send, {Ctrl up}{Shift up}
}

if not (InStr(class,"Chrome_WidgetWin_1")) {
    IfWinNotActive, ahk_class Chrome_WidgetWin_1
    WinActivate, ahk_class Chrome_WidgetWin_1
}
return

Ctrl & WheelDown::
MouseGetPos,,, WinUMID
WinGetClass, class, ahk_id %WinUMID%

if (InStr(class,"Chrome_WidgetWin_1")) {
send, {Ctrl down}{tab}
send, {Ctrl up}
}

if not (InStr(class,"Chrome_WidgetWin_1")) {
    IfWinNotActive, ahk_class Chrome_WidgetWin_1
    WinActivate, ahk_class Chrome_WidgetWin_1
}
return

I wouldn’t want this window to focus every time I execute “Ctrl + WheelUp/Down” because it slows down the tab switching, since I execute the ^+tab code many times while moving the mouse wheel in one direction ↑↓.