I have a little program that runs in the system tray. In the Form_Unload event I have a confirmation message box, which asks the user if they really want to exit. However, if the User does a shutdown, restart, or "Close All Programs and Login in as another user" it still gives the confirmation msgbox. I don't want this to happen. So how do I tell if the user or the system is trying to shut the programs down?