I thought I'd share this code that activates the window under the mouse whenever there is scroll wheel movement. It's very short, but took me a while to figure out (I'm new). Sorry if someone's already posted something similar.
It works quite well, but the originally focussed window still gets some scroll messages before the activation kicks in. I tried to get this to work with a hook instead of the ~ passthrough, but couldn't figure it out. If anyone adds this improvement, please post it here.
Cheers
Matthew
; ------------------------------------------------------------- ; Send scroll wheel movements to the window the mouse is over ; instead of the currently active window ; (currently active window may scroll a little before the new ; activation kicks in because ~ is real pass-through, but I ; couldn't get this working with a proper hook) ; ; I originally checked to see if the current window was already ; active before activating it, but I think that's handled by ; WinActivate without impairing performance ; ------------------------------------------------------------- ; ; Turn on WinActivateForce to prevent flashing ; Note -- this will apply to all functions from this point on #WinActivateForce ~WheelDown:: MouseGetPos,,,win ; Get the window below the mouse WinActivate, ahk_id %win% return ~WheelUp:: MouseGetPos,,,win ; Get the window below the mouse WinActivate, ahk_id %win% return