Occurs when the application is about to shut down.
[Visual Basic] Public Shared Event ApplicationExit As EventHandler [C#] public static event EventHandler ApplicationExit; [C++] public: static __event EventHandler* ApplicationExit;
[JScript] In JScript, you can handle the events defined by a class, but you cannot define your own.
The event handler receives an argument of type EventArgs.
You must attach the event handlers to the Exit event to perform unhandled, required tasks before the application stops running. You can close files opened by this application, or dispose of objects that garbage collection did not reclaim.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family