A Windows utility that creates semi-transparent overlays to dim inactive displays or regions, creating a "spotlight" effect on the active window. Built with .NET 10 and native Windows APIs for optimal performance.
✅ Multi-monitor support - Automatically detects all connected monitors ✅ Configurable overlays - Customize colors and opacity for both inactive and active regions independently ✅ Multiple rendering backends - Choose between:
- LayeredWindow: Extremely lightweight (< 10MB RAM usage)
- CompositeOverlay: Better visual quality during window dragging (~50MB RAM for dual monitor setup with partial overlays) ✅ Small footprint - Less than 50MB installed, installer under 10MB ✅ Click-through overlays - Overlays don't capture mouse input (WS_EX_TRANSPARENT) ✅ 100% event-driven - Uses Windows event hooks instead of polling for zero CPU usage when idle ✅ No admin privileges - Runs as a regular user process ✅ Hot-reloadable configuration - Changes apply instantly without restart ✅ Native AOT compilation - Fast startup and minimal runtime dependencies
The application uses a dual event hook system for comprehensive window tracking:
- EVENT_SYSTEM_FOREGROUND - Instant detection when switching between applications
- EVENT_OBJECT_LOCATIONCHANGE - Real-time detection of window movement:
- Detects windows being dragged between monitors with the mouse
- Detects Win+Arrow and Win+Shift+Arrow keyboard shortcuts
- Filters out cursor/caret events using
OBJID_WINDOWcheck
- EnumDisplayMonitors - Detects all connected monitors
- CreateWindowEx - Creates overlay windows with layered and transparent styles
- SetLayeredWindowAttributes - Sets the semi-transparent appearance with configurable opacity
dotnet builddotnet rundotnet publish -c Release -r win-x64- WinApi.cs - P/Invoke declarations for Windows APIs
- MonitorManager.cs - Multi-monitor detection and management
- OverlayWindow.cs - Semi-transparent, click-through overlay windows
- FocusTracker.cs - Event-driven focus tracking using Windows hooks
- Program.cs - Main application logic and message loop
- 100% event-driven - No polling whatsoever!
- Zero CPU usage when idle - Only activates on actual window changes
- Instant response - Event hooks provide immediate notification of window changes
- Efficient movement detection - Tracks window position and focus changes in real-time
- Native Windows API calls for maximum performance
- AOT compilation eliminates JIT overhead and reduces startup time
SpotlightDimmer can be configured via JSON file located at %AppData%\SpotlightDimmer\config.json. See CONFIGURATION.md for detailed configuration options.