Microsoft.Win32.SystemEvents 9.0.17

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
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 Since .NET 7, non-Windows platforms are not supported, even with the runtime configuration switch. See https://aka.ms/systemdrawingnonwindows for more information.
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 Since .NET 7, non-Windows platforms are not supported, even with the runtime configuration switch. See https://aka.ms/systemdrawingnonwindows for more information.
170
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.
173
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.
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 Since .NET 7, non-Windows platforms are not supported, even with the runtime configuration switch. See https://aka.ms/systemdrawingnonwindows for more information.
160
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.
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 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 Since .NET 7, non-Windows platforms are not supported, even with the runtime configuration switch. See https://aka.ms/systemdrawingnonwindows for more information.
179
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.
228
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.
191
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.
225
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 When using NuGet 3.x this package requires at least version 3.4.
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.
160
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.
161
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.
163
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.
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.
170
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.
182

https://go.microsoft.com/fwlink/?LinkID=799421

.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-preview.5.26302.115 8 06/10/2026
11.0.0-preview.4.26230.115 10 05/13/2026
11.0.0-preview.3.26207.106 23 04/14/2026
11.0.0-preview.2.26159.112 27 03/12/2026
11.0.0-preview.1.26104.118 29 02/11/2026
10.0.9 8 06/10/2026
10.0.8 8 05/13/2026
10.0.7 22 04/21/2026
10.0.6 22 04/14/2026
10.0.5 24 03/16/2026
10.0.4 28 03/12/2026
10.0.3 27 02/11/2026
10.0.2 36 01/14/2026
10.0.1 46 12/13/2025
10.0.0 59 11/12/2025
10.0.0-rc.2.25502.107 67 10/14/2025
10.0.0-rc.1.25451.107 101 09/09/2025
10.0.0-preview.7.25380.108 74 08/14/2025
10.0.0-preview.6.25358.103 90 07/17/2025
10.0.0-preview.5.25277.114 91 06/10/2025
10.0.0-preview.4.25258.110 116 05/13/2025
10.0.0-preview.3.25171.5 99 04/11/2025
10.0.0-preview.2.25163.2 121 04/01/2025
10.0.0-preview.1.25080.5 102 04/01/2025
9.0.17 8 06/10/2026
9.0.16 9 05/13/2026
9.0.15 20 04/14/2026
9.0.14 26 03/12/2026
9.0.13 30 02/11/2026
9.0.12 33 01/14/2026
9.0.11 67 11/12/2025
9.0.10 87 10/14/2025
9.0.9 95 09/09/2025
9.0.8 80 08/05/2025
9.0.7 84 07/09/2025
9.0.6 104 06/11/2025
9.0.5 107 05/14/2025
9.0.4 98 04/11/2025
9.0.3 115 03/31/2025
9.0.2 113 03/31/2025
9.0.1 119 04/01/2025
9.0.0 106 11/14/2024
9.0.0-rc.2.24473.5 94 10/21/2024
9.0.0-rc.1.24431.7 134 09/20/2024
9.0.0-preview.7.24405.7 119 08/21/2024
9.0.0-preview.6.24327.7 139 07/18/2024
9.0.0-preview.5.24306.7 103 07/18/2024
9.0.0-preview.4.24266.19 112 07/18/2024
9.0.0-preview.3.24172.9 135 07/18/2024
9.0.0-preview.2.24128.5 134 07/18/2024
9.0.0-preview.1.24080.9 121 07/18/2024
8.0.0 141 07/18/2024
8.0.0-rc.2.23479.6 146 07/18/2024
8.0.0-rc.1.23419.4 141 07/18/2024
8.0.0-preview.7.23375.6 123 07/18/2024
8.0.0-preview.6.23329.7 120 07/18/2024
8.0.0-preview.5.23280.8 153 07/18/2024
8.0.0-preview.4.23259.5 150 07/18/2024
8.0.0-preview.3.23174.8 130 07/18/2024
8.0.0-preview.2.23128.3 130 07/18/2024
8.0.0-preview.1.23110.8 119 07/18/2024
7.0.0 242 02/05/2024
7.0.0-rc.2.22472.3 136 07/18/2024
7.0.0-rc.1.22426.10 148 07/18/2024
7.0.0-preview.7.22375.6 103 07/18/2024
7.0.0-preview.6.22324.4 133 07/18/2024
7.0.0-preview.5.22301.12 125 07/18/2024
7.0.0-preview.4.22229.4 129 07/18/2024
7.0.0-preview.3.22175.4 123 07/18/2024
7.0.0-preview.2.22152.2 144 07/18/2024
7.0.0-preview.1.22076.8 118 07/18/2024
6.0.1 116 07/18/2024
6.0.0 173 02/04/2024
6.0.0-rc.2.21480.5 127 07/18/2024
6.0.0-rc.1.21451.13 133 07/18/2024
6.0.0-preview.7.21377.19 143 07/18/2024
6.0.0-preview.6.21352.12 123 07/18/2024
6.0.0-preview.5.21301.5 125 07/18/2024
6.0.0-preview.4.21253.7 132 07/18/2024
6.0.0-preview.3.21201.4 124 07/18/2024
6.0.0-preview.2.21154.6 113 07/18/2024
6.0.0-preview.1.21102.12 124 07/18/2024
5.0.0 129 03/18/2024
5.0.0-rc.2.20475.5 120 07/18/2024
5.0.0-rc.1.20451.14 139 07/18/2024
5.0.0-preview.8.20407.11 125 07/18/2024
5.0.0-preview.7.20364.11 148 07/18/2024
5.0.0-preview.6.20305.6 126 07/18/2024
5.0.0-preview.5.20278.1 128 07/18/2024
5.0.0-preview.4.20251.6 122 07/18/2024
5.0.0-preview.3.20214.6 117 07/18/2024
5.0.0-preview.2.20160.6 127 07/18/2024
5.0.0-preview.1.20120.5 125 07/18/2024
4.7.0 148 02/04/2024
4.7.0-preview3.19551.4 146 07/18/2024
4.7.0-preview2.19523.17 119 07/18/2024
4.7.0-preview1.19504.10 123 07/18/2024
4.6.0 134 07/18/2024
4.6.0-rc1.19456.4 119 07/18/2024
4.6.0-preview9.19421.4 124 07/18/2024
4.6.0-preview9.19416.11 125 07/18/2024
4.6.0-preview8.19405.3 146 07/18/2024
4.6.0-preview7.19362.9 116 07/18/2024
4.6.0-preview6.19303.8 127 07/18/2024
4.6.0-preview6.19264.9 111 07/18/2024
4.6.0-preview5.19224.8 122 07/18/2024
4.6.0-preview4.19212.13 144 07/18/2024
4.6.0-preview3.19128.7 131 07/18/2024
4.6.0-preview.19073.11 123 07/18/2024
4.6.0-preview.18571.3 128 07/18/2024
4.5.0 133 07/18/2024
4.5.0-rc1 120 07/18/2024
4.5.0-preview2-26406-04 118 07/18/2024