I tried all the examples on this forum to do this but none seemed to work - the "X" botton still functioned. My big issue is that I create some temp files for WAV and AVI data and want to kill the files when the program closes. With exit buttons or menu selection my code executes fine and all files are eliminated but with the "X" button the clean-up is not done.

Thus I need a very short & consice method of either:

1.) Disabling the "X" button

OR

2.) So mehow executing the cleanup routine when "X" is pressed.

Thanks for any help you can give...again please do not redirect me to existing code links since they did not work...I already tried them.