Brenda,
I think you can use the queryunload event of your top level form. It should execute whenever the window is closed without using THISFORM.Release() in code. If you put NODEFAULT in this event, the form won't close.
><snip>
>
>>Check out the ON SHUTDOWN comamnd.
>
>i use a toplevelform (not _screen). also want to execute a proc or custom method to check it is a valid exit before exiting. i tried the "ON SHUTDOWN DO exit_app" in my main. exit_app is a proc in my "SET PROCEDURE TO .prg". put an assert .f. in exit_app and it is never executed.
>
>any ideas
>
>brenda