See Also: ApplicationContext Members
You can use the System.Windows.Forms.ApplicationContext class to redefine the circumstances that cause a message loop to exit. By default, the System.Windows.Forms.ApplicationContext listens to the Form.Closed event on the application's main System.Windows.Forms.Form, then exits the thread's message loop.