SystemEvents.EventsThreadShutdown Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
SystemEvents.EventsThreadShutdown callbacks are not run before the process exits. Use AppDomain.ProcessExit instead.
Occurs before the thread that listens for system events is terminated.
public:
static event EventHandler ^ EventsThreadShutdown;
[System.Obsolete("SystemEvents.EventsThreadShutdown callbacks are not run before the process exits. Use AppDomain.ProcessExit instead.", DiagnosticId="SYSLIB0059", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static event EventHandler? EventsThreadShutdown;
public static event EventHandler EventsThreadShutdown;
public static event EventHandler? EventsThreadShutdown;
[<System.Obsolete("SystemEvents.EventsThreadShutdown callbacks are not run before the process exits. Use AppDomain.ProcessExit instead.", DiagnosticId="SYSLIB0059", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.EventsThreadShutdown : EventHandler
member this.EventsThreadShutdown : EventHandler
Public Shared Custom Event EventsThreadShutdown As EventHandler
Event Type
- Attributes
Exceptions
System event notifications are not supported under the current context. Server processes, for example, might not support global system event notifications.
The attempt to create a system events window thread did not succeed.
Remarks
This event is raised as the thread that listens for system events is about to be terminated. System event delegates are invoked using the thread that listens for system events.
Caution
Because this is a static event, you must detach your event handlers when your application is disposed, or memory leaks will result.