How can I handle cleanup to my application with just a single console window (no GUI), when the user click the 'X' button in the right-top corner? Thanks.