Application Exit event : Application « Development « C# / CSharp Tutorial






using System;
using System.Windows.Forms;

public class MainClass : System.Windows.Forms.Form
{
  public MainClass()
  {
    Application.ApplicationExit += new EventHandler(Form_OnExit);
  }

  [STAThread]
  static void Main() 
  {
    Application.Run(new MainClass());
  }
  private void Form_OnExit(object sender, EventArgs evArgs) 
  {
    Console.WriteLine("Exit");
  }
}








14.1.Application
14.1.1.Application Startup Path
14.1.2.Get CompanyName, ProductName and StartupPath from Application
14.1.3.Application Exit event
14.1.4.Application.AddMessageFilter
14.1.5.Working with Thread Exceptions