I'm currently working on an application of mine and I need to detect when the computer is shutting down. The reason why is that I need to send a message using the Network object when the computer is shutting down. This particular application runs on startup and runs in the background. When you exit it minimizes to the system tray. So the only way to end it is to end the process. I want to detect a shutdown and send the message before the application is ended.