In the Form1_Close Sub, I'd like to be able to know if the event was fired by the AppClose keyword, the user clicking the red 'X' button or whether Windows is shutting down and has sent it a WMClose message. I'd then be able to process the close request accordingly.