Microsoft.Win32.SystemEvents 9.0.23

About

Provides support for accessing Windows system event notifications, which can be crucial for applications to respond to changes in the system or user environment​. Through this assembly, applications can subscribe to a set of global system events provided by the SystemEvents class, gaining the ability to react to changes like system power mode alterations, user preference modifications, and session switches, among others.

Key Features

  • Access to a set of global system events
  • Notification of changes in user preferences
  • Notification of system power mode changes
  • Notification of session switches

How to Use

An example of how to use the SystemEvents class to react to system changes:

using Microsoft.Win32;

// Set the SystemEvents class to receive event notification when a user
// preference changes, the palette changes, or when display settings change.
SystemEvents.UserPreferenceChanging += UserPreferenceChanging;
SystemEvents.PaletteChanged += PaletteChanged;
SystemEvents.DisplaySettingsChanged += DisplaySettingsChanged;

// For demonstration purposes, this application sits idle waiting for events.
Console.WriteLine("This application is waiting for system events.");
Console.WriteLine("Press <Enter> to terminate this application.");
Console.ReadLine();

// This method is called when a user preference changes.
static void UserPreferenceChanging(object sender, UserPreferenceChangingEventArgs e)
{
    Console.WriteLine($"The user preference is changing. Category={e.Category}");
}

// This method is called when the palette changes.
static void PaletteChanged(object sender, EventArgs e)
{
    Console.WriteLine("The palette changed.");
}

// This method is called when the display settings change.
static void DisplaySettingsChanged(object sender, EventArgs e)
{
    Console.WriteLine("The display settings changed.");
}

In this example, the methods will be invoked whenever the user modifies one of several system settings.

Main Types

The main types provided by this library are:

  • Microsoft.Win32.SystemEvents
  • Microsoft.Win32.PowerModeChangedEventHandler
  • Microsoft.Win32.SessionEndedEventHandler
  • Microsoft.Win32.UserPreferenceChangedEventHandler

Additional Documentation

Feedback & Contributing

Microsoft.Win32.SystemEvents is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on Microsoft.Win32.SystemEvents.

Packages Downloads
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
180
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
171
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
168
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon Unix support is disabled by default. See https://aka.ms/systemdrawingnonwindows for more information.
167
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon 30ab651fcb4354552bd4891619a0bdd81e0ebdbf When using NuGet 3.x this package requires at least version 3.4.
166
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
166
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon Since .NET 7, non-Windows platforms are not supported, even with the runtime configuration switch. See https://aka.ms/systemdrawingnonwindows for more information.
164
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
162
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
159
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon
158
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
157
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon Since .NET 7, non-Windows platforms are not supported, even with the runtime configuration switch. See https://aka.ms/systemdrawingnonwindows for more information.
156
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
155
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon Since .NET 7, non-Windows platforms are not supported, even with the runtime configuration switch. See https://aka.ms/systemdrawingnonwindows for more information.
153
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon 43e382ec5469a9a81d9a57f09dd08e500b0cf7af When using NuGet 3.x this package requires at least version 3.4.
153
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
153
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon Unix support is disabled by default. See https://aka.ms/systemdrawingnonwindows for more information.
153
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
151
System.Drawing.Common
Provides access to GDI+ graphics functionality. Commonly Used Types: System.Drawing.Bitmap System.Drawing.BitmapData System.Drawing.Brush System.Drawing.Font System.Drawing.Graphics System.Drawing.Icon When using NuGet 3.x this package requires at least version 3.4.
150

.NET Framework 4.6.2

  • No dependencies.

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET Standard 2.0

  • No dependencies.

Version Downloads Last updated
11.0.0 4 11/11/2026
11.0.0-rc.3.26522.148 10 10/26/2026
11.0.0-rc.2.26504.105 11 10/14/2026
11.0.0-rc.1.26425.128 17 9/10/2026
11.0.0-preview.7.26381.103 21 8/12/2026
11.0.0-preview.6.26359.118 19 7/19/2026
11.0.0-preview.5.26302.115 25 6/10/2026
11.0.0-preview.4.26230.115 35 5/13/2026
11.0.0-preview.3.26207.106 35 5/3/2026
11.0.0-preview.2.26159.112 40 3/12/2026
11.0.0-preview.1.26104.118 36 2/11/2026
10.0.15 2 11/11/2026
10.0.14 9 10/27/2026
10.0.13 13 10/14/2026
10.0.12 16 9/10/2026
10.0.11 19 8/12/2026
10.0.10 21 7/18/2026
10.0.9 35 6/10/2026
10.0.8 33 5/13/2026
10.0.7 33 5/3/2026
10.0.6 34 5/4/2026
10.0.5 35 3/15/2026
10.0.4 37 3/12/2026
10.0.3 32 2/11/2026
10.0.2 40 1/17/2026
10.0.1 48 12/13/2025
10.0.0 60 11/12/2025
10.0.0-rc.2.25502.107 77 10/17/2025
10.0.0-rc.1.25451.107 81 9/10/2025
10.0.0-preview.7.25380.108 79 8/14/2025
10.0.0-preview.6.25358.103 81 7/16/2025
10.0.0-preview.5.25277.114 89 6/8/2025
10.0.0-preview.4.25258.110 105 5/13/2025
10.0.0-preview.3.25171.5 94 4/14/2025
10.0.0-preview.2.25163.2 86 3/23/2025
10.0.0-preview.1.25080.5 92 2/26/2025
9.0.23 2 11/11/2026
9.0.22 9 10/27/2026
9.0.21 11 10/14/2026
9.0.20 18 9/9/2026
9.0.19 19 8/12/2026
9.0.18 23 7/18/2026
9.0.17 25 6/10/2026
9.0.16 33 5/13/2026
9.0.15 46 5/3/2026
9.0.14 37 3/12/2026
9.0.13 37 2/11/2026
9.0.12 40 1/18/2026
9.0.11 56 11/12/2025
9.0.10 71 10/17/2025
9.0.9 74 9/10/2025
9.0.8 101 8/5/2025
9.0.7 79 7/12/2025
9.0.6 80 6/15/2025
9.0.5 95 5/14/2025
9.0.4 99 4/11/2025
9.0.3 98 3/14/2025
9.0.2 112 2/18/2025
9.0.1 99 1/18/2025
9.0.0 107 11/14/2024
9.0.0-rc.2.24473.5 103 10/8/2024
9.0.0-rc.1.24431.7 126 9/17/2024
9.0.0-preview.7.24405.7 134 8/13/2024
9.0.0-preview.6.24327.7 134 7/10/2024
9.0.0-preview.5.24306.7 134 6/14/2024
9.0.0-preview.4.24266.19 127 5/28/2024
9.0.0-preview.3.24172.9 133 4/19/2024
9.0.0-preview.2.24128.5 130 3/30/2024
9.0.0-preview.1.24080.9 141 2/29/2024
8.0.0 158 11/15/2023
8.0.0-rc.2.23479.6 156 11/13/2023
8.0.0-rc.1.23419.4 160 9/18/2023
8.0.0-preview.7.23375.6 147 8/20/2023
8.0.0-preview.6.23329.7 147 8/2/2023
8.0.0-preview.5.23280.8 165 8/4/2023
8.0.0-preview.4.23259.5 152 6/25/2023
8.0.0-preview.3.23174.8 170 5/14/2023
8.0.0-preview.2.23128.3 137 5/17/2023
8.0.0-preview.1.23110.8 139 2/23/2023
7.0.0 154 12/5/2022
7.0.0-rc.2.22472.3 152 12/5/2022
7.0.0-rc.1.22426.10 172 9/16/2022
7.0.0-preview.7.22375.6 170 9/16/2022
7.0.0-preview.6.22324.4 147 9/16/2022
7.0.0-preview.5.22301.12 170 6/28/2022
7.0.0-preview.4.22229.4 138 6/28/2022
7.0.0-preview.3.22175.4 130 6/28/2022
7.0.0-preview.2.22152.2 137 6/28/2022
7.0.0-preview.1.22076.8 144 6/28/2022
6.0.2-mauipre.1.22102.15 150 6/28/2022
6.0.2-mauipre.1.22054.8 157 6/28/2022
6.0.1 160 6/28/2022
6.0.0 157 6/28/2022
6.0.0-rc.2.21480.5 139 6/28/2022
6.0.0-rc.1.21451.13 143 6/28/2022
6.0.0-preview.7.21377.19 136 6/28/2022
6.0.0-preview.6.21352.12 154 6/28/2022
6.0.0-preview.5.21301.5 153 6/28/2022
6.0.0-preview.4.21253.7 140 6/28/2022
6.0.0-preview.3.21201.4 168 6/28/2022
6.0.0-preview.2.21154.6 149 6/28/2022
6.0.0-preview.1.21102.12 139 6/28/2022
5.0.0 147 6/28/2022
5.0.0-rc.2.20475.5 155 6/28/2022
5.0.0-rc.1.20451.14 136 6/28/2022
5.0.0-preview.8.20407.11 136 6/28/2022
5.0.0-preview.7.20364.11 165 6/28/2022
5.0.0-preview.6.20305.6 158 6/28/2022
5.0.0-preview.5.20278.1 165 6/28/2022
5.0.0-preview.4.20251.6 162 6/28/2022
5.0.0-preview.3.20214.6 164 6/28/2022
5.0.0-preview.2.20160.6 136 6/28/2022
5.0.0-preview.1.20120.5 160 6/28/2022
4.7.0 173 6/28/2022
4.7.0-preview3.19551.4 143 6/28/2022
4.7.0-preview2.19523.17 164 6/28/2022
4.7.0-preview1.19504.10 141 6/28/2022
4.6.0 160 6/28/2022
4.6.0-rc1.19456.4 152 6/28/2022
4.6.0-preview9.19421.4 164 6/28/2022
4.6.0-preview9.19416.11 143 6/28/2022
4.6.0-preview8.19405.3 140 6/28/2022
4.6.0-preview7.19362.9 141 6/28/2022
4.6.0-preview6.19303.8 148 6/28/2022
4.6.0-preview6.19264.9 161 6/28/2022
4.6.0-preview5.19224.8 147 6/28/2022
4.6.0-preview4.19212.13 154 6/28/2022
4.6.0-preview3.19128.7 156 6/28/2022
4.6.0-preview.19073.11 155 6/28/2022
4.6.0-preview.18571.3 144 6/28/2022
4.5.0 140 6/28/2022
4.5.0-rc1 134 6/28/2022
4.5.0-preview2-26406-04 139 6/28/2022