Scroll two windows simultaneously
notepad_notepad.mp4
chromium_vscode.mp4
The program uses the SetWindowsHookEx
function to install a hook procedure that monitors low-level mouse events. When the user scrolls the source window, the program uses SendInput
to simulate the same scroll event on the target window.
The program reads the configuration from the appsettings.json
file. The configuration file must be in the same directory as the executable file.
When "IsLegacyModeEnabled": true
, the program uses SendMessage
(instead of SendInput
) to send the WM_MOUSEWHEEL
(or WM_MOUSEHWHEEL
) message to the target window.
When "IsStrictProcessIdCheckEnabled": true
, the program uses WindowFromPoint
+ GetWindowThreadProcessId
to prevent scrolling the target window if the target or source window is currently not in the foreground.
- https://badecho.com/index.php/2024/01/13/external-window-messages/
- https://badecho.com/index.php/2024/01/17/message-queue-messages/
- https://github.com/microsoft/CsWin32
- https://github.com/dahall/vanara
- https://www.codeproject.com/Articles/6362/Global-System-Hooks-in-NET
- https://github.com/rvknth043/Global-Low-Level-Key-Board-And-Mouse-Hook
- https://sharphook.tolik.io/v5.3.7/
- https://github.com/TolikPylypchuk/libuiohook
- https://github.com/jaredpar/pinvoke-interop-assistant
- KatMouse
- WizMouse
- X-Mouse Controls
- AlwaysMouseWheel