A lightweight Windows tray app that shows which virtual desktop you're on as a
number in the system tray. The number updates instantly when you switch desktops
(e.g. Win+Ctrl+← / →).
The number is drawn as large white digits with a black outline (subtitle style), so it stays readable on any taskbar color — light or dark.
- Live desktop number in the tray, updated the moment you switch.
- Tooltip shows position and desktop name, e.g.
Desktop 7/8 — Work. - Start with Windows toggle (right-click the tray icon).
- Single instance — launching again does nothing.
- Windows 10 or 11.
- .NET 10 SDK to build (a published single-file exe only needs the .NET 10 Desktop Runtime, or nothing if built self-contained).
Quick build:
dotnet build -c ReleaseThe executable lands in bin\Release\net10.0-windows\VirtualDesktopNumberIndicator.exe.
Framework-dependent (small; needs the .NET 10 Desktop Runtime installed):
dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=trueSelf-contained (larger; runs on any Windows 10/11 with no runtime installed):
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishSingleFile=trueOutput: bin\Release\net10.0-windows\win-x64\publish\VirtualDesktopNumberIndicator.exe.
Just run the .exe. It shows an icon in the tray with the current desktop number.
Make it always visible: Windows hides new tray icons in the overflow (
^) by default and apps can't force them out. On first run a notification reminds you — drag the number from the overflow onto the taskbar once, or go to Settings ▸ Personalization ▸ Taskbar ▸ Other system tray icons and turn it on. Windows remembers the choice.
To start it automatically at login, right-click the tray icon and enable Start with Windows.
To quit, right-click the tray icon and choose Exit.
The app reads the current virtual desktop from the registry rather than using undocumented COM APIs, so it stays stable across Windows updates:
- Current desktop GUID:
HKCU\...\Explorer\VirtualDesktops → CurrentVirtualDesktop(falls back to the per-sessionSessionInfo\<id>\VirtualDesktopskey on older builds). - Ordered desktop list:
HKCU\...\Explorer\VirtualDesktops → VirtualDesktopIDs(the current GUID's index in this list + 1 is the number shown). - Names:
HKCU\...\Explorer\VirtualDesktops\Desktops\{GUID} → Name.
Updates are pushed via RegNotifyChangeKeyValue (instant), with a 1-second
polling fallback as a safety net.
| File | Purpose |
|---|---|
Program.cs |
Entry point, single-instance mutex. |
TrayAppContext.cs |
Tray icon, context menu, wiring. |
DesktopWatcher.cs |
Registry reads + change notifications. |
IconRenderer.cs |
Renders the number into a tray icon. |
StartupManager.cs |
"Start with Windows" registry entry. |
app.manifest |
Windows 10/11 + per-monitor DPI awareness. |