void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e) { System.Windows.Forms.Application.Exit(); }