
MirrorOverlay
A frameless, always-on-top floating window that mirrors any other monitor — including a VDD virtual display (Indirect Display Driver, e.g. the MTT1337 Virtual Display Driver) — onto your main screen. Useful for keeping an eye on a headless / virtual screen that nothing is physically plugged into. Capture uses DXGI Desktop Duplication (GPU, 15–60 fps, includes the mouse cursor) with an automatic GDI BitBlt fallback. It auto-detects the VDD monitor on first run.
- Drag the top strip — move the window. Drag a corner — resize (aspect locked by default). Drag the body — pan the picture when zoomed in.
- Mouse wheel — zoom the picture, anchored at the pointer.
Shift+wheel — resize the window instead. +/-zoom in / out ·0fit to window · arrow keys pan · 100% is true 1:1 source pixels.Ctrl+click — send a real mouse click to the matching spot on the source display. Works in click-through mode too (a click-through window normally never sees the mouse, so the click is caught with a low-level hook). HoldCtrland a yellow crosshair shows the exact source coordinate that will be clicked. The physical cursor is moved to the target and put back right after, so your mouse does not disappear onto the virtual screen.Ctrl+right-click sends a right click.- Right click — menu including a Zoom submenu (Fit / 50 / 100 / 200 / 400%), source monitor, frame rate (15/24/30/60), opacity, capture engine, click-through, always-on-top, border, info label.
Nnext source ·Cclick-through ·Llabel ·Eschide to tray · double-click toggles click-through.- With click-through on, the overlay ignores the mouse entirely — you can click "through" it at whatever is underneath.
SendInput using MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK — without VIRTUALDESK the coordinates are normalised over the primary monitor only and clicks land in the wrong place on a secondary display. Source pixels are converted to logical screen coordinates using the monitor's DPI ratio (this box's VDD is 1920×1080 physical but 1536×864 logical, i.e. 125%). Injected input cannot reach windows running at a higher integrity level, so an elevated target app will not see the click unless MirrorOverlay is also run elevated. The feature can be turned off from the right-click menu (“Ctrl+click sends a click to the source display”).app.ico (16 / 20 / 24 / 32 / 40 / 48 / 64 / 96 / 128 / 256, BMP entries for the small ones and PNG-compressed for 128 & 256) is compiled into the exe by app.rc and used for the file icon, the window and the tray. It is generated from scratch by make_icon.py — pure Python, no Pillow: signed-distance rendering with 4× supersampling, plus a hand-rolled PNG writer and ICO packer. The glyph is the overlay panel (accent blue, with a title bar) floating over the dimmer source display it mirrors. Small sizes get their own hinting tier (thicker strokes, bigger panels, no content lines) so 16×16 stays legible in the tray.Download the four required files below into one empty folder and run build.bat. Needs MinGW-w64 / g++ (the script auto-detects the usual install path, otherwise falls back to g++ on PATH). No IDE, no make, no dependencies to install.
| File | Size | What it is |
|---|---|---|
| MirrorOverlay.cpprequired | 54 KB | The whole program — single translation unit: Win32 window, DXGI desktop duplication + GDI BitBlt capture, zoom / pan, Ctrl+click injection, tray icon, ini settings. |
| app.rcrequired | 1 KB | Resource script. Embeds app.ico as resource 101 and adds the version-info block (file description, product name, version) you see in Explorer's Properties dialog. |
| app.icorequired | 97 KB | The app icon referenced by app.rc: 10 sizes (16 / 20 / 24 / 32 / 40 / 48 / 64 / 96 / 128 / 256). Windows drops it on Explorer / taskbar / Alt-Tab, and the program loads resource 101 for the window and the tray icon. Build still succeeds without it, but the exe ends up with the generic icon. |
| build.batrequired | 1 KB | One-shot build: runs windres on app.rc to make app_res.o, then compiles and links MirrorOverlay.exe. Safe to re-run; it skips the resource step automatically if app.rc is absent. |
| make_icon.pyoptional | 9 KB | Regenerates app.ico from scratch — pure standard-library Python, no Pillow needed. Only needed if you want to tweak the icon. See the App icon note above. |
| preview_sizes.pyoptional | 3 KB | Renders a contact sheet of the icon at every size on light and dark backgrounds. Companion to make_icon.py while editing. |
| smoketest.cppoptional | 10 KB | Verification harness: launches the exe, samples the composited desktop where the overlay sits, and asserts the picture is actually there (flicker scan, zoom / pan deltas). Not linked into the app. |
| icontest.cppoptional | 7 KB | Checks the embedded icon: enumerates RT_GROUP_ICON in the built exe, extracts both icon sizes, and reads back the running window's icons. |
| probe.cppoptional | 10 KB | Diagnostic: lists every monitor, its device name and DPI, and reports whether DXGI DuplicateOutput works on each one. Handy for confirming a virtual display is capturable before running the app. |
Equivalent to running by hand (this is exactly what build.bat does):
rem 1. compile the resource (icon + version info) - see note below about the 8.3 path windres -I. -O coff -i app.rc -o app_res.o rem 2. compile and link g++ -O2 -mwindows MirrorOverlay.cpp app_res.o -o MirrorOverlay.exe ^ -ld3d11 -ldxgi -ldxguid -lgdi32 -luser32 -lshell32 -lwinmm
Gotcha with windres: if MinGW lives under C:\Program Files\..., invoking it by its long path fails with 'C:\Program' is not recognized / preprocessing failed — windres derives the preprocessor path from its own location and does not quote it. Call it through the 8.3 short path instead (C:\PROGRA~1\...), which is what build.bat does. Running the app's folder from a path with spaces is fine; only the windres call is affected.
Runtime settings are written to MirrorOverlay.ini next to the exe — delete it to reset to defaults. If a link above downloads as text, right-click and choose Save link as….
heYYape