🟣 C# / .NET 6+
Disable Lock Screen Notifications (C#)
Stops app notifications from appearing on the lock screen. Applies the tweak via Microsoft.Win32.Registry.
SetDisableLockScreenNotifications.cs
// SetDisableLockScreenNotifications.cs
//
// Disable Lock Screen Notifications.
// Stops app notifications from appearing on the lock screen.
//
// Usage: dotnet new console -o SetDisableLockScreenNotifications, replace Program.cs with this
// file, then dotnet run.
using System;
using Microsoft.Win32;
using RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\PushNotifications");
key.SetValue("LockScreenToastEnabled", 0, RegistryValueKind.DWord);
Console.WriteLine("Disable Lock Screen Notifications applied.");