Scroll two windows simultaneously
notepad_notepad.mp4
chromium_vscode.mp4
- WinSyncScroll.exe - The main application that users should run to synchronize scrolling between two windows.
- WinSyncScroll.VisualTestUtil.exe - (Optional) A debugging utility that helps visualize which events are being received by the target window. Only needed for troubleshooting.
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.
This mode is needed for:
- Older operating systems that don't have the "Scroll inactive windows when hovering over them" setting
- Remote Desktop (RDP) sessions
- Users who prefer this mode because the cursor won't flicker
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.
If the application doesn't work, try the following:
- Check Windows settings - Make sure the "Scroll inactive windows when hovering over them" option is enabled in Windows Settings → Mouse (or enable Legacy mode if this option is unavailable)
- Enable Legacy mode - Set
"IsLegacyModeEnabled": trueinappsettings.json - Run as administrator - Right-click the executable and select "Run as administrator"
- Disable strict process id check - Set
"IsStrictProcessIdCheckEnabled": falseinappsettings.json
- 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