Is there any way that we can write function/code for close icon (top right corner of the window). When my program run it creates temp files which needs to be cleared when user click on this icon. Any help?