Is this you main application windows?
Did you add a close button or you are using the window close of the ControlBox?
Also, if you are using a Classe object form and you have code in your Unload Event of the classe, if you have type anything in your Form's Unload Event it will overwrite the Class Unload Event unless you do DODEFAULT()