Deskband11Lib.Wpf
1.2.0
dotnet add package Deskband11Lib.Wpf --version 1.2.0
NuGet\Install-Package Deskband11Lib.Wpf -Version 1.2.0
<PackageReference Include="Deskband11Lib.Wpf" Version="1.2.0" />
<PackageVersion Include="Deskband11Lib.Wpf" Version="1.2.0" />
<PackageReference Include="Deskband11Lib.Wpf" />
paket add Deskband11Lib.Wpf --version 1.2.0
#r "nuget: Deskband11Lib.Wpf, 1.2.0"
#:package Deskband11Lib.Wpf@1.2.0
#addin nuget:?package=Deskband11Lib.Wpf&version=1.2.0
#tool nuget:?package=Deskband11Lib.Wpf&version=1.2.0
Deskband11Lib
🌐 English | 한국어
Deskband11Lib is a library for building rich, always-visible taskbar companions on Windows 11. It lets your app place real UI content directly inside the taskbar, making compact dashboards, quick controls, status indicators, media widgets, launchers, and productivity tools feel like a native part of the desktop.
Packages
Deskband11Lib comes in multiple NuGet packages, one for each supported UI framework. A shared Deskband11Lib.Core package holds the taskbar hosting engine. Future frameworks such as Avalonia can be added as additional facade packages.
| Package | Description |
|---|---|
Deskband11Lib.Core |
Taskbar window discovery, layout calculation, UI Automation measurement, Explorer restart monitoring, and Win32 HWND hosting engine. Independent of any UI framework. |
Deskband11Lib.WinUI |
WinUI 3 facade. Build taskbar widgets with the same WinUI controls, styling, and composition features used by your app. |
Deskband11Lib.Wpf |
WPF facade. Bring WPF-based content into the Windows 11 taskbar with the same simple API. |
Highlights
- Build taskbar-resident widgets using your framework's native controls and styling.
- Show live information where users can see it at a glance without opening a full window.
- Add compact controls for actions such as timers, media playback, account switching, build status, device monitoring, or quick launch workflows.
- Automatically fit content into the available taskbar space without overlapping pinned apps or the notification area.
- Built-in easing functions (Linear, Sine, Quadratic, Cubic, Quartic, Quintic, Exponential, Circle) for smooth layout animations.
- Recover cleanly when Explorer restarts by letting the application rebuild its hosted window.
- WinUI facade supports Windows App SDK apps and NativeAOT publishing.
Install
Choose the package that matches your UI framework:
# WinUI 3
dotnet add package Deskband11Lib.WinUI
# WPF
dotnet add package Deskband11Lib.Wpf
The Deskband11Lib.Core package is pulled in automatically as a transitive dependency.
Basic Usage
WinUI 3
Create a WinUI window, create a TaskbarContentHost, attach it after the initial taskbar layout is ready, then activate the window.
using Deskband11Lib.Core;
using Deskband11Lib.WinUI;
var window = new MainWindow();
var host = new TaskbarContentHost(window, rootElement, new TaskbarContentHostOptions
{
PreferredWidth = 360,
PreferredHeight = 48
});
await host.AttachWhenLayoutReadyAsync();
window.Activate();
WPF
The WPF API is identical. The only difference is the UI framework namespace used for Window and FrameworkElement.
using Deskband11Lib.Core;
using Deskband11Lib.Wpf;
var window = new MainWindow();
var host = new TaskbarContentHost(window, rootElement, new TaskbarContentHostOptions
{
PreferredWidth = 360,
PreferredHeight = 48
});
await host.AttachWhenLayoutReadyAsync();
window.Show();
Explorer Restart
When Explorer restarts, the taskbar destroys the hosted child window. Handle TaskbarWindowRecreated to replace the window:
host.TaskbarWindowRecreated += async (_, _) =>
{
await RecreateMainWindowAsync();
};
How It Works
Deskband11Lib gives your app a taskbar-sized surface and keeps that surface aligned with the real taskbar layout. Internally, it uses regular Win32 window parenting:
- Finds the primary taskbar window,
Shell_TrayWnd. - Creates or receives a normal framework
Windowfrom the application. - Changes the window style from popup-style top-level window to child window.
- Calls
SetParentto place the window under the taskbar. - Calculates the available rectangle between the taskbar buttons and the notification area, taking taskbar alignment (left or center) into account.
- Moves and clips the hosted window to that rectangle with
SetWindowPosandSetWindowRgn.
Taskbar button width is not reliable from the taskbar child HWND hierarchy alone on current Windows 11 builds, and the taskbar content can be left-aligned or centered. Deskband11Lib therefore uses UI Automation to precisely target the Start button (AutomationId = StartButton) and the optional Widgets button, plus the contiguous taskbar app button group. It also reads the taskbar alignment from the registry (TaskbarAl) and falls back to inferring it from the Start button position. Based on alignment, it picks the more spacious of the two free gaps around the centered Start button group, so content never overlaps the Start button, app buttons, Widgets button, or the notification area. The UI Automation scan runs off the UI thread and is cached so layout refreshes do not block the hosted content.
Options
All options live in Deskband11Lib.Core.TaskbarContentHostOptions and are shared across all facades.
| Option | Default | Description |
|---|---|---|
PreferredWidth |
360 |
Desired content width in effective pixels. |
PreferredHeight |
48 |
Desired content height in effective pixels. |
AnimateLayoutChanges |
true |
Animates taskbar host position and size changes. |
LayoutAnimationDuration |
500 |
Layout animation duration in milliseconds. |
LayoutAnimationEasing |
EasingFunctions.CircleOut |
Easing delegate (Func<double, double>) for layout animation. Built-in non-overshooting functions are provided by Deskband11Lib.Core.EasingFunctions. |
Placement |
Auto |
Auto picks the more spacious free gap when the taskbar is centered, and falls back to BeforeNotificationArea when left-aligned. BeforeNotificationArea always places content next to the notification area. BeforeStartButton places content next to the Start button and falls back to Auto when the taskbar is not centered. |
TrackTaskbarButtons |
true |
Enables UI Automation based taskbar button measurement. |
TrackNotificationArea |
true |
Keeps content away from the notification area. |
LayoutRefreshInterval |
500 ms |
Refresh interval for ongoing taskbar layout updates. |
Taskbar Alignment
Deskband11Lib detects whether the Windows 11 taskbar is left-aligned or centered by reading the TaskbarAl registry value, falling back to inferring the alignment from the Start button position. Call GetTaskbarAlignment() on a TaskbarContentHost to get a TaskbarAlignment (Left, Center, or Unknown). The detected alignment drives Placement = Auto.
Built-in Easing Functions
Deskband11Lib.Core.EasingFunctions provides these easing functions for LayoutAnimationEasing:
EasingFunctions.LinearEasingFunctions.SineIn/SineOut/SineInOutEasingFunctions.QuadraticIn/QuadraticOut/QuadraticInOutEasingFunctions.CubicIn/CubicOut/CubicInOutEasingFunctions.QuarticIn/QuarticOut/QuarticInOutEasingFunctions.QuinticIn/QuinticOut/QuinticInOutEasingFunctions.ExponentialIn/ExponentialOut/ExponentialInOutEasingFunctions.CircleIn/CircleOut/CircleInOut
You can also pass any Func<double, double> delegate for custom easing.
Sample Projects
The snippets above show the core API shape, but a real taskbar companion should follow the sample projects for window lifetime, startup ordering, Explorer restart recovery, and framework-specific hosting details. Start from the sample that matches your UI stack:
Deskband11Lib.WinUI.Samplefor WinUI 3 and Windows App SDK apps.Deskband11Lib.Wpf.Samplefor WPF apps, including the transparent borderless host window setup.
Requirements
- Windows 11.
- The target framework must be compatible with your chosen UI framework.
- WinUI 3 requires Windows App SDK.
- WPF requires
UseWPF=truein the project file.
Project Development
dotnet restore
dotnet build Deskband11Lib.slnx -c Debug
dotnet publish Deskband11Lib.WinUI.Sample\Deskband11Lib.WinUI.Sample.csproj -c Release -r win-x64
Acknowledgements
Special thanks to zadjii and Deskband11. The core idea of bringing application content into the Windows 11 taskbar comes from that project, and Deskband11Lib is grateful for the brilliant inspiration.
License
Deskband11Lib is licensed under the MIT License.
Author
Created by Howon Lee (airtaxi).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.26100 is compatible. |
-
net10.0-windows10.0.26100
- Deskband11Lib.Core (>= 1.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.