Skip to content

magicxor/WinSyncScroll

Repository files navigation

WinSyncScroll

release Coverage Badge Ask DeepWiki

Scroll two windows simultaneously

Demo

notepad_notepad.mp4
chromium_vscode.mp4

Usage

  • 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.

How it works

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.

Configuration

The program reads the configuration from the appsettings.json file. The configuration file must be in the same directory as the executable file.

Legacy mode

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

Strict process id check

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.

Troubleshooting

If the application doesn't work, try the following:

  1. 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)
  2. Enable Legacy mode - Set "IsLegacyModeEnabled": true in appsettings.json
  3. Run as administrator - Right-click the executable and select "Run as administrator"
  4. Disable strict process id check - Set "IsStrictProcessIdCheckEnabled": false in appsettings.json

See also: