<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Abdelhamid Qaiss]]></title><description><![CDATA[Abdelhamid Qaiss]]></description><link>https://qaiss.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 11:56:08 GMT</lastBuildDate><atom:link href="https://qaiss.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I put a video wallpaper behind the Windows 11 desktop icons]]></title><description><![CDATA[The WorkerW trick, why it broke on Windows 11 24H2, and how a single C# app does animated wallpapers, a transparent taskbar and a screensaver.]]></description><link>https://qaiss.hashnode.dev/how-i-put-a-video-wallpaper-behind-the-windows-11-desktop-icons</link><guid isPermaLink="true">https://qaiss.hashnode.dev/how-i-put-a-video-wallpaper-behind-the-windows-11-desktop-icons</guid><category><![CDATA[c sharp]]></category><category><![CDATA[dotnet]]></category><category><![CDATA[Windows]]></category><category><![CDATA[windows 11]]></category><dc:creator><![CDATA[Abdelhamid QAISS]]></dc:creator><pubDate>Tue, 24 Nov 2026 14:48:16 GMT</pubDate><content:encoded><![CDATA[<p>I wanted an animated wallpaper on Windows 11 without paying for Wallpaper Engine and without running a heavy background app. So I built <strong>Astra Desk</strong>: a free, open-source Windows 11 app (one C# file plus one HTML file for the UI) that does:</p>
<ul>
<li>video / GIF / image wallpapers with effects (sakura, rain, glitch...)</li>
<li>a fully transparent custom taskbar</li>
<li>an animated screensaver and a lock screen snapshot</li>
<li>a desktop clock and one-click window tiling</li>
</ul>
<p>Site: <a href="https://www.astra-desk.xyz">https://www.astra-desk.xyz</a> · Code: <a href="https://github.com/QaissA/astra-desk">https://github.com/QaissA/astra-desk</a></p>
<p>This post is about the most interesting part: <strong>how do you draw a window <em>behind</em> the desktop icons?</strong></p>
<h2>The desktop is just windows</h2>
<p>On Windows, the desktop is a tree of windows owned by Explorer:</p>
<ul>
<li><code>Progman</code> is the top-level "Program Manager" window.</li>
<li><code>SHELLDLL_DefView</code> holds the icon list (<code>SysListView32</code>).</li>
<li>The wallpaper is painted behind it.</li>
</ul>
<p>If you make a normal window and push it to the bottom of the z-order, it still sits <strong>above</strong> the icons' parent, so the icons disappear. You need to get <em>between</em> the wallpaper and the icons.</p>
<h2>The classic trick: message 0x052C</h2>
<p>Explorer has an undocumented message, <code>0x052C</code>. Send it to <code>Progman</code> and Explorer splits the desktop: it creates a separate <code>WorkerW</code> window behind the icon host. Parent your window to that <code>WorkerW</code> and you are exactly where you want to be: above the wallpaper, below the icons.</p>
<pre><code class="language-csharp">var progman = Native.FindWindow("Progman", null);
// ask Explorer to spawn the WorkerW layer
Native.SendMessageTimeout(progman, 0x052C, 0xD, 1, 0, 1000, out _);
Native.SendMessageTimeout(progman, 0x052C, 0, 0, 0, 1000, out _);

var defView = FindDefView();                 // SHELLDLL_DefView
var host = Native.GetParent(defView);
var worker = Native.FindWindowEx(0, host, "WorkerW", null); // the WorkerW right after the icons' host
</code></pre>
<p>Every live-wallpaper app since about 2015 uses some form of this.</p>
<h2>What changed in Windows 11 24H2</h2>
<p>On 24H2 the old code silently stopped working for me: no error, just no wallpaper. The desktop tree changed. The icons no longer move into a separate <code>WorkerW</code>; <code>SHELLDLL_DefView</code> <strong>stays inside</strong> <code>Progman</code>. And a child window of <code>Progman</code> is only drawn if it is a <strong>layered</strong> window.</p>
<p>So the code checks which layout it got:</p>
<pre><code class="language-csharp">if (host == progman)
    return (progman, defView, true);   // 24H2+: icons stay inside Progman, insert below DefView, must be layered
return (worker != 0 ? worker : progman, 0, false); // classic layout
</code></pre>
<p>And when attaching the window:</p>
<pre><code class="language-csharp">if (layered) // Win11 24H2+: children of Progman must be layered to be drawn
{
    Native.SetWindowLong(f.Handle, GWL_EXSTYLE, Native.GetWindowLong(f.Handle, GWL_EXSTYLE) | WS_EX_LAYERED);
    Native.SetLayeredWindowAttributes(f.Handle, 0, 255, LWA_ALPHA);
}
// a popup can't be re-parented: turn it into a real child window first
Native.SetWindowLong(f.Handle, GWL_STYLE, (style &amp; ~WS_POPUP) | WS_CHILD);
Native.SetParent(f.Handle, parent);
Native.SetWindowPos(f.Handle, insertAfter, x, y, w, h, SWP_NOACTIVATE | SWP_SHOWWINDOW);
</code></pre>
<p>Two details that cost me time:</p>
<ol>
<li><code>SetParent</code> <strong>on a</strong> <code>WS_POPUP</code> <strong>window doesn't do what you think.</strong> Flip it to <code>WS_CHILD</code> first.</li>
<li><strong>Coordinates are relative to the virtual screen</strong>, not the primary monitor. With a monitor to the left of the primary one, <code>X</code> is negative, so subtract <code>SystemInformation.VirtualScreen.X/Y</code>. One window per screen.</li>
</ol>
<h2>Playing the video: WebView2</h2>
<p>I didn't want to ship a video decoder. Windows 11 already has the <strong>WebView2</strong> runtime, so each wallpaper window is a WinForms <code>Form</code> with a <code>WebView2</code> filling it, pointing at a local page with a <code>&lt;video&gt;</code> tag. Local folders are mapped to virtual hosts so nothing goes through a web server:</p>
<pre><code class="language-csharp">wv.CoreWebView2.SetVirtualHostNameToFolderMapping("media.local", folder, CoreWebView2HostResourceAccessKind.Allow);
wv.CoreWebView2.Navigate("https://app.local/wallpaper.html");
</code></pre>
<p>Hardware video decoding, CSS effects (sakura, rain, glitch) and the clock overlay come for free from the browser engine.</p>
<h2>Not eating your battery</h2>
<p>A wallpaper that keeps decoding video while you game is a bad wallpaper. It pauses when:</p>
<ul>
<li>a full-screen app or game is running: <code>SHQueryUserNotificationState</code> tells you this directly (busy / presentation mode / D3D full screen)</li>
<li>you're on battery (optional): <code>SystemInformation.PowerStatus.PowerLineStatus</code></li>
<li>you're away: <code>GetLastInputInfo</code></li>
</ul>
<p>Pausing just calls <code>setPaused(true)</code> in the page, so the <code>&lt;video&gt;</code> stops and the GPU goes idle.</p>
<h2>The transparent taskbar</h2>
<p>The custom bar is registered as an <strong>app bar</strong> with <code>SHAppBarMessage</code> (<code>ABM_NEW</code>, <code>ABM_QUERYPOS</code>, <code>ABM_SETPOS</code>), the same API the real taskbar uses. That way maximized windows stop at the bar instead of going under it, and <code>ABM_REMOVE</code> gives the space back when you quit. The Windows taskbar is set to auto-hide, and restored when you uninstall.</p>
<h2>The lock screen</h2>
<p>The lock screen can't play video, so the app grabs a frame from the wallpaper's WebView2 and calls <code>Windows.System.UserProfile.LockScreen.SetImageFileAsync</code> (that's why the project targets <code>net10.0-windows10.0.19041.0</code>). The animated version is the screensaver.</p>
<h2>Credits</h2>
<p>Astra Desk doesn't ship any wallpapers. It only searches and downloads from <a href="https://wallhaven.cc">Wallhaven</a>, <a href="https://moewalls.com">MoeWalls</a> and <a href="https://motionbgs.com">MotionBgs</a> (plus Pexels and Pixabay with your own free key). The wallpapers belong to their artists and studios. Please support the creators, keep downloads on your own desktop, and don't redistribute their work.</p>
<h2>Try it / read it</h2>
<ul>
<li>Download (installs per user, no admin): <a href="https://www.astra-desk.xyz">https://www.astra-desk.xyz</a></li>
<li>Source (.NET 10, <code>dotnet build -c Release</code>): <a href="https://github.com/QaissA/astra-desk">https://github.com/QaissA/astra-desk</a></li>
</ul>
<p>If you've done desktop-layer tricks on 24H2 and found edge cases (multi-monitor with mixed DPI, Explorer restarts), I'd love to hear them in the comments.</p>
<p><em>Originally published on</em> <a href="https://dev.to/abdelhamid_qaiss_16bb6fd9/how-i-put-a-video-wallpaper-behind-the-windows-11-desktop-icons-and-what-changed-in-24h2-56j0"><em>DEV</em></a><em>.</em></p>
]]></content:encoded></item></channel></rss>