Skip to main content
net6.0-windows7.0net7.0-windows7.0net8.0-windows7.0

Applies a dark theme to the titlebar of Win32 windows via window handles (HWND).

Published
Mar 16, 2024
2y ago
Total Downloads
1.4K
1,445

Install

dotnet add package Sungaila.ImmersiveDarkMode --version 1.0.0
ProductVersions
.NET
net6.0-windows7.0net7.0-windows7.0net8.0-windows7.0

README

ImmersiveDarkMode Logo Sungaila.ImmersiveDarkMode

GitHub Workflow Build Status SonarCloud Quality Gate NuGet version NuGet downloads GitHub license

Applies a dark theme to the titlebar of Win32 windows. Can also be toggled automatically whenever the system-wide application theme changes.

Works on Windows 11 (Build 22000) and newer.

Windows Forms

Add the following NuGet package: Sungaila.ImmersiveDarkMode.WinForms

Call WindowExtensions.SetTitlebarTheme() in the constructor of your System.Windows.Forms.Form and override WndProc like this:

public Form1()
{
    InitializeComponent();
    this.SetTitlebarTheme();
}

protected override void WndProc(ref Message m)
{
    base.WndProc(ref m);
    WindowExtensions.CheckAppsThemeChanged(m);
}

Windows UI Library 3

Add the following NuGet package: Sungaila.ImmersiveDarkMode.WinUI

Call WindowExtensions.InitTitlebarTheme() in the constructor of your Microsoft.UI.Xaml.Window like this:

public Window1()
{
    InitializeComponent();
    this.InitTitlebarTheme();
}

Windows Presentation Foundation

Add the following NuGet package: Sungaila.ImmersiveDarkMode.Wpf

Call WindowExtensions.InitTitlebarTheme() in the constructor of your System.Windows.Window like this:

public Window1()
{
    InitializeComponent();
    this.InitTitlebarTheme();
}

Changes from Previous Version

No structural changes between v1.0.0-preview and v1.0.0.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.