A Windows system tray application that remembers window positions and restores them when monitors are reconnected.
When you disconnect a monitor (or it turns off), Windows moves all windows to the remaining display. When the monitor comes back, the windows stay crammed on one screen instead of returning to their original positions.
This app:
- Captures window positions in real-time using Windows event hooks
- Detects when monitors are reconnected
- Automatically restores windows to their saved positions
dotnet run
Or build and run the executable directly. The app runs in the system tray.
- Track Windows Now - Manually save current positions
- Restore Windows Now - Manually restore to saved positions
- Show Recent Logs - View recent activity
- Open Config Folder - Access config files
- Tracked Programs - View which programs are being tracked
Edit config.json in the application directory:
{
"programs": [
"chrome.exe",
"zen.exe",
"Obsidian.exe",
"thunderbird.exe"
],
"debounceDelayMs": 500,
"restoreDelayMs": 1000,
"requiredMonitorCount": 2
}| Setting | Description |
|---|---|
programs |
List of executable names to track (find in Task Manager > Details) |
debounceDelayMs |
Delay after window movement before saving position (default: 500) |
restoreDelayMs |
Delay after monitor reconnect before restoring (default: 1000) |
requiredMonitorCount |
Number of monitors required to track/restore (default: 2) |
- Uses Windows event hooks (
SetWinEventHook) to capture window movements immediately - Debounces rapid changes (e.g., during window dragging) before saving
- Uses
SystemEvents.DisplaySettingsChangedto detect monitor changes - Skips minimized and unresponsive windows
- Identifies windows by process name + window title hash (handles multiple windows per app)
- Preserves Z-order (window stacking) when restoring
- Only tracks/restores when required monitors are connected
- Windows 10/11
- .NET 10.0 or later