closing the program means?protect thru control box(close window) or by alt+f4.
if u want to control some thru the control box. u must set up the form property ControlBox=False.
this property disappear the min,max,close option in the control bar.
try this and i hope this will help u.
webspy