I was wondering, how can i catch the event when someone clicks on the little X in the right corner of an application? I need to do some processing and checking right before the application closes i just dont see what to catch to be able to do that.