Toggle the Windows 11 taskbar auto-hide state with a global hotkey — a single ~6 KB C# executable with zero dependencies.
- Press the hotkey → taskbar switches between always show and auto hide instantly
- Stays 100% in sync with
Settings > Personalization > Taskbar > Automatically hide the taskbar(it flips the exact registry value that UI writes) - Resident listener registers the hotkey via
RegisterHotKey— response is millisecond-level, not the 1–5 s lag you get from.lnkshortcut hotkeys - Idle footprint: 0% CPU (blocking message loop, no polling), ~9 MB private memory
- No installer, no runtime to download, no admin rights needed
- Windows 11 has no built-in hotkey for this (confirmed by Microsoft Q&A, 2026-03).
- The common DIY recipe (desktop shortcut hotkey + PowerShell script) is slow:
.lnkhotkeys are processed lazily by Explorer, then PowerShell + C# runtime compilation adds seconds. Measured on a real machine: 4 s end-to-end; the actual toggle logic takes 8–21 ms. - Existing utilities either hide the taskbar by manipulating its window (breaks right-click / edge reveal / crashes reported), or are AHK scripts that require installing the AutoHotkey runtime.
This tool does the minimal correct thing: flip the persisted auto-hide bit, apply it live via the official AppBar API, and own the hotkey in-process.
The auto-hide state lives in:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3
value "Settings" (REG_BINARY), byte index 8:
0x02 = always show (ABS_ALWAYSONTOP)
0x03 = auto hide (ABS_ALWAYSONTOP | ABS_AUTOHIDE)
Toggle = flip bit 0x01 of that byte, then call shell32.SHAppBarMessage(ABM_SETSTATE) so Explorer applies it immediately without a restart. Because the persisted value is the same one the Settings UI reads, the two never drift apart.
The hotkey is a plain RegisterHotKey(MOD_CONTROL | MOD_ALT, 'T') + GetMessage loop inside the exe — the same mechanism AHK uses, without AHK.
Note:
HKCU\...\Explorer\Advanced\TaskbarAlis icon alignment (0 = center, 1 = left), not auto-hide. Several popular tutorials confuse the two — this tool never touches it.
One line with the compiler that ships with Windows (.NET Framework 4.x, present on every Win10/11):
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /nologo /optimize /target:winexe /out:ToggleTaskbar.exe src\ToggleTaskbar.csOr run build.ps1.
ToggleTaskbar.exe # one-shot toggle (double-click friendly)
ToggleTaskbar.exe --listen # register global hotkey Ctrl+Alt+T and stay resident
Recommended setup:
- Build the exe.
- Create a shortcut to
ToggleTaskbar.exe --listeninshell:startup→ hotkey works after every sign-in. - (Optional) A plain shortcut to the exe (no arguments) on the desktop for double-click toggling.
Edit in src/ToggleTaskbar.cs:
const uint VK_T = 0x54; // virtual-key code of the keythen rebuild. Any VK code works, e.g. 0x48 = H. Modifier is currently MOD_CONTROL | MOD_ALT.
| Metric | Value |
|---|---|
| Working set | 16.4 MB (mostly shared .NET runtime images) |
| Private memory | 9.4 MB |
| CPU while idle | 0% (blocking GetMessage) |
| Toggle logic | 8–21 ms (internal stopwatch) |
| Network / disk | none (one log line per toggle if enabled) |
- Windows 11 24H2 (26100), single primary taskbar
- Multi-monitor secondary taskbars (
Shell_SecondaryTrayWnd) are not toggled — only the primaryStuckRects3entry is modified
| Approach | Drawback |
|---|---|
.lnk shortcut hotkey + script |
Explorer processes shortcut hotkeys lazily → 1–5 s delay |
| Buttery Taskbar 2 etc. (window-hiding tools) | break right-click / edge reveal; stability reports vary |
| AutoHotkey scripts | same result, but requires the AHK runtime installed |
MIT — see LICENSE.