Host your own UI inside the Windows 11 taskbar Windows 11 작업 표시줄 안에 직접 만든 UI를 띄워 보세요
Deskband11Lib parents your window to the taskbar and fits it into the free space between the app buttons and the notification area. Use it for timers, media controls, build status, or anything else that should stay in view without opening a window.
Deskband11Lib는 앱 창을 작업 표시줄의 자식 창으로 붙이고, 앱 버튼과 알림 영역 사이에 남는 공간에 맞춰 크기를 조정합니다. 타이머, 미디어 컨트롤, 빌드 상태처럼 별도 창을 열지 않고도 늘 보여야 하는 기능에 활용할 수 있습니다.
dotnet add package Deskband11Lib.WinUI
Quick start시작하기
Create a window, pass it and its root element to TaskbarContentHost, then attach it once the taskbar layout is ready. WinUI 3 and WPF share the same API; only the Window and FrameworkElement types come from different namespaces.
창을 만든 다음 창과 루트 요소를 TaskbarContentHost에 넘기고, 작업 표시줄 레이아웃이 준비되면 창을 붙입니다. WinUI 3와 WPF는 같은 API를 사용하며, Window와 FrameworkElement 타입의 네임스페이스만 다릅니다.
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();
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();
Recreate the window when the taskbar drops it창이 사라지면 다시 만들기
An Explorer restart, a disconnected monitor, or a DPI change can destroy the hosted window or leave it misaligned. Handle TaskbarWindowRecreationRequired, build a new window, and attach a new host.
Explorer가 재시작되거나, 모니터 연결이 끊기거나, DPI가 바뀌면 호스팅된 창이 사라지거나 위치가 어긋날 수 있습니다. TaskbarWindowRecreationRequired 이벤트에서 창을 새로 만들고 새 호스트를 붙이면 됩니다.
host.TaskbarWindowRecreationRequired += async (_, _) => await RecreateMainWindowAsync();
| Event이벤트 | Raised when발생 시점 |
|---|---|
TaskbarWindowRecreationRequired |
Any of the cases below. One handler is enough for most apps.아래 모든 경우에 발생합니다. 대부분의 앱은 이 핸들러 하나로 충분합니다. |
TaskbarWindowRecreated |
Explorer restarted, or a disconnected monitor came back.Explorer가 재시작되었거나, 연결이 끊겼던 모니터가 다시 연결되었습니다. |
TaskbarDpiChanged |
The taskbar moved to a new DPI. The library hides and detaches the old window first.작업 표시줄의 DPI가 바뀌었습니다. 라이브러리가 기존 창을 먼저 숨기고 분리합니다. |
TaskbarWindowDisappeared |
The monitor hosting the widget was disconnected. The new host uses the primary taskbar until that monitor returns.위젯을 붙여 둔 모니터의 연결이 끊겼습니다. 그 모니터가 다시 연결될 때까지 새 호스트는 기본 작업 표시줄을 사용합니다. |
The snippets show the shape of the API. For window lifetime, startup order, and framework-specific hosting, start from the WinUI 3 sample or the WPF sample, which also sets up a transparent borderless host window.
위 코드는 API의 형태만 보여 줍니다. 창 수명 주기, 시작 순서, 프레임워크별 호스팅 처리는 WinUI 3 샘플이나 WPF 샘플에서 시작하시는 것을 권장합니다. WPF 샘플에는 테두리 없는 투명 호스트 창 설정도 들어 있습니다.
Placement배치
UI Automation locates the Start button, the app buttons, the Widgets button, and the notification area. Content goes into one of the free gaps between them, chosen by the Placement option and the taskbar alignment, which is read from the TaskbarAl registry value.
UI Automation으로 시작 버튼, 앱 버튼, 위젯 버튼, 알림 영역의 위치를 찾습니다. 콘텐츠는 그 사이에 남는 공간 중 한 곳에 배치되며, 어느 공간을 쓸지는 Placement 옵션과 작업 표시줄 정렬에 따라 정해집니다. 작업 표시줄 정렬은 레지스트리의 TaskbarAl 값에서 읽습니다.
Example layout: a 1920 px wide taskbar and the default content width of 360 px.
예시 레이아웃: 너비 1920px 작업 표시줄에 기본 너비 360px 콘텐츠를 배치한 경우입니다.
Several instances in one area한 영역을 나눠 쓰는 여러 인스턴스
Instances that target the same area on the same monitor coordinate through a shared-memory slot registry and split the space without overlapping. Fixed instances, with a finite PreferredWidth, are served first in ManualSlotPriority order, then in arrival order. Stretch instances, with PreferredWidth = double.MaxValue, share whatever is left.
같은 모니터의 같은 영역을 대상으로 하는 인스턴스들은 공유 메모리 슬롯 레지스트리로 서로 조정하여 겹치지 않게 공간을 나눕니다. PreferredWidth가 유한한 Fixed 인스턴스가 ManualSlotPriority 순서, 그다음 도착 순서에 따라 먼저 너비를 받고, PreferredWidth = double.MaxValue인 Stretch 인스턴스들은 남은 공간을 똑같이 나눕니다.
| Instance인스턴스 | Mode방식 | PreferredWidth | ManualSlotPriority | Allocated할당된 너비 |
|---|
Example instances using BeforeNotificationArea, started in the order Media, Build status, Timer. The first slot in order sits next to the notification area. Widths are effective pixels at 100% scaling.
미디어, 빌드 상태, 타이머 순서로 시작한 예시 인스턴스이며, 모두 BeforeNotificationArea를 사용합니다. 순서상 첫 번째 슬롯이 알림 영역 바로 옆에 놓입니다. 너비는 배율 100% 기준의 effective pixel입니다.
Options옵션
All options live in Deskband11Lib.Core.TaskbarContentHostOptions and work the same in every package.
모든 옵션은 Deskband11Lib.Core.TaskbarContentHostOptions에 정의되어 있으며, 어느 패키지에서든 똑같이 동작합니다.
| Option옵션 | Default기본값 | Description설명 |
|---|---|---|
PreferredWidth |
360 |
Content width in effective pixels. double.MaxValue makes the instance Stretch.콘텐츠 너비입니다(effective pixel). double.MaxValue로 설정하면 Stretch 인스턴스가 됩니다. |
PreferredHeight |
48 |
Content height in effective pixels.콘텐츠 높이입니다(effective pixel). |
Placement |
Auto |
Which free gap the content goes into: Auto, LeftEdge, BeforeStartButton, or BeforeNotificationArea. See Placement.콘텐츠를 배치할 공간을 고릅니다. Auto, LeftEdge, BeforeStartButton, BeforeNotificationArea 중 하나이며, 자세한 내용은 배치 항목에서 확인할 수 있습니다. |
PreferredMonitorIdentity |
0 |
0 uses the primary taskbar. 1 and up pick secondary taskbars from left to right, falling back to the primary taskbar when that monitor is missing.0이면 기본 작업 표시줄을 사용합니다. 1부터는 화면 왼쪽부터 순서대로 보조 모니터의 작업 표시줄을 고르며, 해당 모니터가 없으면 기본 작업 표시줄로 돌아갑니다. |
ManualSlotPriority |
65535 |
Order among instances in the same area. Lower values come first; equal values keep arrival order.같은 영역에 있는 인스턴스 사이의 순서를 정합니다. 값이 낮을수록 앞에 오고, 값이 같으면 도착 순서를 따릅니다. |
AllowFixedSlotResize |
true |
When space runs short, Fixed instances shrink in proportion to their PreferredWidth instead of dropping to zero.공간이 부족할 때 Fixed 인스턴스가 0까지 줄어드는 대신 PreferredWidth 비율에 맞춰 줄어듭니다. |
AnimateLayoutChanges |
true |
Animates position and size changes.위치와 크기가 바뀔 때 애니메이션을 적용합니다. |
LayoutAnimationDuration |
500 |
Layout animation duration in milliseconds.레이아웃 애니메이션 시간입니다(밀리초). |
LayoutAnimationEasing |
EasingFunctions.CircleOut |
Any Func<double, double>. EasingFunctions provides Linear and the Sine, Quadratic, Cubic, Quartic, Quintic, Exponential, and Circle families in In, Out, and InOut forms.Func<double, double> 형식이면 무엇이든 사용할 수 있습니다. EasingFunctions에는 Linear와 함께 Sine, Quadratic, Cubic, Quartic, Quintic, Exponential, Circle 계열의 In, Out, InOut 함수가 들어 있습니다. |
HighRefreshRateMode |
false |
Matches the animation timer to the monitor's current refresh rate instead of 60 FPS.애니메이션 타이머를 60 FPS 대신 모니터의 현재 주사율에 맞춥니다. |
TrackTaskbarButtons |
true |
Measures the taskbar buttons with UI Automation.UI Automation으로 작업 표시줄 버튼 영역을 측정합니다. |
TrackNotificationArea |
true |
Keeps content clear of the notification area.콘텐츠가 알림 영역을 침범하지 않게 합니다. |
LayoutRefreshInterval |
500 ms |
How often the taskbar layout is checked again.작업 표시줄 레이아웃을 다시 확인하는 주기입니다. |
Packages and requirements패키지와 요구 사항
| Package패키지 | Description설명 | |
|---|---|---|
Deskband11Lib.WinUI |
WinUI 3 facade for Windows App SDK apps. Supports NativeAOT publishing.Windows App SDK 기반 WinUI 3 앱용 패키지입니다. NativeAOT 게시를 지원합니다. | NuGet |
Deskband11Lib.Wpf |
WPF facade. Requires UseWPF=true in the project file.WPF 앱용 패키지입니다. 프로젝트 파일에 UseWPF=true가 필요합니다. |
NuGet |
Deskband11Lib.Core |
Taskbar window discovery, layout calculation, UI Automation measurement, Explorer restart monitoring, and Win32 HWND hosting. Installed automatically with either package above.작업 표시줄 창 탐색, 레이아웃 계산, UI Automation 측정, Explorer 재시작 감지, Win32 HWND 호스팅을 담당합니다. 위 패키지 중 하나를 설치하면 함께 설치됩니다. | NuGet |
- Windows 11.
- .NET 10. The packages target
net10.0-windows10.0.26100.0. - WinUI 3 apps need the Windows App SDK.
- Windows 11이 필요합니다.
- .NET 10이 필요합니다. 패키지의 대상 프레임워크는
net10.0-windows10.0.26100.0입니다. - WinUI 3 앱에는 Windows App SDK가 필요합니다.