DEV Community

klimek-dev
klimek-dev

Posted on

How I solved Windows 11 icon toggling with a lightweight C# app and Win32 API

I love keeping my desktop completely clean, but toggling icons on Windows 10 and 11 requires too many clicks through context menus. Additionally, recent Windows builds often silently ignore standard WM_COMMAND shell messages.

To fix this, I built Desktop Icon Toggler — a tiny, zero-dependency C# tool designed to be pinned directly to the taskbar.

How it works under the hood
Instead of relying on shell context messages, the app uses P/Invoke to target the native SysListView32 window container directly in memory:

Maps the desktop window hierarchy (Progman / WorkerW -> SHELLDLL_DefView).

Locates the SysListView32 icon container.

Toggles memory visibility via ShowWindow (SW_HIDE / SW_SHOW).

It runs, toggles the state, and exits immediately — using 0% background RAM.

Key Features
1-Click Taskbar Toggle: Show or hide desktop icons instantly.

Zero Resource Footprint: Runs and closes in milliseconds.

Single Executable: Native x64 build with no extra installers needed.

100% Open Source: MIT Licensed with a clean VirusTotal report.

Links & Repository
Feel free to check out the code, download the latest release, or leave a star if you find it useful!

GitHub Repository: https://github.com/klimek-dev/desktop-icon-toggler

Download Latest Release: https://github.com/klimek-dev/desktop-icon-toggler/releases

Top comments (0)