WinFocus is a free, open-source Windows utility that shows which monitor and which window currently have keyboard focus on a multi-monitor setup. It draws a thin colored border around the active monitor and a second border around the active window, so you always know where your typing will go.
Illustration of the default look: 3 px orange monitor border, 2 px azure window border. Colors and widths are configurable.
- Monitor frame: an orange border around the monitor that holds the focused window.
- Window frame: an azure border around the focused window itself, hidden while that window is maximized or fullscreen.
Both borders follow keyboard focus instantly. They are click-through, never take focus, and never appear in the taskbar or Alt-Tab. There is no tray icon, no settings window, and no background service: one small native executable (about 150 KB) and nothing else.
Works on Windows 10 and Windows 11 with two, three, or more monitors, any mix of resolutions, and any DPI scaling.
- Anyone with dual or triple monitors who keeps typing into the wrong screen.
- Keyboard-driven users (Alt-Tab, Win+Arrow, tiling tools) who want a visible focus indicator without a mouse cursor.
- Developers and traders with several terminals, IDEs, or dashboards open at once.
- Users who find Windows' default active-window highlighting too subtle, especially with dark themes or borderless apps.
winget install rhrusha.WinFocus
winfocus --install
Approve the administrator prompt. The borders appear immediately and return automatically every time you sign in.
The winget package is a portable install: winget places winfocus.exe in its
packages folder and adds winfocus to your PATH. (Until the package is
accepted into the winget community repository, use the manual install below.)
-
Download
winfocus.exefrom the latest release, or build it yourself (see below). Put it somewhere permanent, for exampleC:\Tools\WinFocus\winfocus.exe. -
Open a terminal in that folder and run:
winfocus.exe --install -
Approve the administrator prompt.
There are no other files, registry settings, or services.
The scheduled task points at the exe, and Windows will not let winget replace or delete an exe that is running. Always stop WinFocus first:
winfocus --uninstall # stops it and removes the scheduled task
winget uninstall rhrusha.WinFocus
To upgrade through winget:
winfocus --stop
winget upgrade rhrusha.WinFocus
winfocus --install # re-creates the task, starts the new version
If you upgrade without stopping first, winget reports that the file is in
use; run winfocus --stop and try again. For a manual install, winfocus.exe --uninstall then deleting the exe is all there is.
It creates a hidden Scheduled Task named WinFocus that starts the exe at
your logon with highest privileges. Highest privileges are needed so the
borders can also be drawn above elevated windows such as Task Manager or an
administrator terminal. The task points at the exe's current location, so
if you move the exe, run --install again from the new place.
winfocus.exe [options] run until --stop (no autostart)
winfocus.exe --stop stop the running instance
winfocus.exe --install [options] start at logon (asks for admin)
winfocus.exe --uninstall remove autostart and stop
winfocus.exe --help
winfocus.exe --version
Options (widths are 0..20 physical pixels, 0 turns that border off):
--color RRGGBB monitor frame color (default FF8C00)
--width N monitor frame width (default 3)
--window-color RRGGBB window frame color (default 00A8FF)
--window-width N window frame width (default 2)
Examples:
winfocus.exe --install --color 00FF00 --width 2 green 2 px monitor border
winfocus.exe --install --window-width 0 monitor border only
winfocus.exe --install --width 0 --window-color FF00FF window border only, magenta
Options given to --install are saved in the task. Running --install
again replaces the previous settings.
The exe is a windowed program, so when you run it from a terminal the prompt
may come back before its output is printed. In cmd, start /wait winfocus.exe --stop waits for it. When there is no terminal, results appear in a message
box.
WinFocus is written in C against the Win32 API with no frameworks or runtimes.
- Each border is made of four tiny layered, topmost, click-through windows, one per edge. Moving a border is four window moves; nothing is repainted, so there is no flicker under the Desktop Window Manager.
- Focus changes, window moves and resizes, and display changes arrive
through Windows accessibility events (
SetWinEventHook). Nothing is polled. The process sleeps between events and uses a few megabytes of memory. - The window border is placed just outside the window's visible edge, taken from the DWM extended frame bounds, so it never covers content. Where the window touches a monitor edge (for example after snapping with Win+Left), that side is drawn just inside the window so it stays visible.
- The window border is hidden while the focused window is maximized, fullscreen, the desktop, or the taskbar. The monitor border is hidden only for fullscreen windows (fullscreen video, an F11 browser, a game), so nothing is drawn over them.
- The exe is per-monitor DPI aware, so widths are exact physical pixels on every screen.
- Only one instance runs at a time. Extra launches exit silently.
Does Windows have a built-in way to highlight the active monitor? No. Windows 10 and 11 have no setting that marks which monitor has keyboard focus. The active window gets a one-pixel accent border at most, which is easy to miss on large or dark displays. WinFocus fills that gap.
Is this a Windows service? No. A true Windows service runs in Session 0 and cannot draw on your desktop. WinFocus runs as a hidden per-user process started by a Scheduled Task at logon, which gives the same "always on" behavior without a service.
Does it slow down games or video? No. It reacts only to focus and window events and draws nothing while a fullscreen application has focus.
Does it work with multiple monitors at different DPI scaling? Yes. The program is per-monitor DPI aware (PerMonitorV2), so a 3 px border is 3 physical pixels on a 4K display and on a 1080p display alike.
Does it work above elevated (administrator) windows?
Yes, when installed with --install, which runs it with highest
privileges. When started by hand without administrator rights, the borders
may not follow elevated windows.
Can I change the colors and thickness?
Yes, with --color, --width, --window-color, and --window-width.
Width 0 turns a border off, so you can keep only the monitor border or only
the window border.
Does it need .NET, Visual C++ redistributables, or an installer? No. It is a single statically linked native exe with no dependencies.
Is it safe? Why the administrator prompt?
The prompt appears only for --install and --uninstall, to create or
delete the Scheduled Task. The source is a single C file you can read in a
few minutes and build yourself.
How do I stop or remove it?
winfocus.exe --stop stops it until next logon. winfocus.exe --uninstall
removes the autostart task and stops it.
Requirements: Visual Studio 2022 Build Tools (or Visual Studio) with the "Desktop development with C++" workload. No other dependencies.
build.cmd
Output: bin\winfocus.exe, about 150 KB, statically linked.
build_debug.cmd builds the same exe with event logging to
%TEMP%\winfocus_debug.log, one line per focus, show, or move event and per
frame update. Useful when some application's border misbehaves.
src/winfocus.c the whole program
src/version.h version number (used by --version, the exe resource, winget)
src/winfocus.manifest per-monitor DPI awareness
src/winfocus.rc embeds the manifest and the version resource
build.cmd release build
build_debug.cmd build with event logging
winget/manifests/ winget package manifests, one folder per version
docs/design/ design notes
- Bump the four values in
src/version.h. build.cmd, then create a GitHub release taggedvX.Y.Zwithbin\winfocus.exeattached.- Copy
winget/manifests/r/rhrusha/WinFocus/<previous>/to a new version folder, updatePackageVersion,InstallerUrl,ReleaseDate,ReleaseNotesUrl, andInstallerSha256(fromGet-FileHash bin\winfocus.exe). Check withwinget validate <folder>. - Submit the folder to
microsoft/winget-pkgs, for
example with
wingetcreate update rhrusha.WinFocus -u <exe url> -v X.Y.Z --submit.
There is no automated test suite; the program is a thin layer over Win32 window management and is verified by hand. After a change, walk through:
- Focus windows on each monitor: the monitor border follows immediately.
- Focus a normal window: the window border hugs its edge. Move and resize it: the border follows.
- Snap a window to a screen edge: the window border stays visible on that side.
- Maximize the focused window: the window border disappears, the monitor border stays. Restore it: the window border returns.
- Monitors with different DPI scaling: both borders are exactly N physical pixels on each.
- Fullscreen video or an F11 browser: both borders disappear; they return after Esc.
- Focus an elevated app such as Task Manager: borders still visible when running from the installed task.
- Click on a border: the click reaches the window underneath.
- Alt-Tab and the taskbar show no WinFocus entry.
- Unplug or plug in a monitor: no crash; the borders land on a valid monitor.
--stopends the process; a second launch exits silently.--installcreates the task and survives a reboot;--uninstallremoves it and stops the process.
active monitor indicator, focused window border, highlight active window, which monitor has focus, multi-monitor focus indicator, dual monitor keyboard focus, active window highlighter, Windows 11 focus border, Windows 10 active screen highlight, screen edge border, window frame overlay.
MIT. See LICENSE.
