Thanks.
To answer your question, what i was looking for was to ensure that if at anytime , if somewhere in my prgram the user closes the program using the "X" that my program will actually close properly and release it's influence on the system's resources.

Thanks for your help.