Well I just tried what you are describing (I tried it in 6.0). It works exactly as I would expect it to.
How is your cleanup procedure getting called? I must be missing something in your message but this is what I see:
program execution will stop at the read events and cleanup will never get called unless you issue a clear events (or call the cleanup from somewhere above read events. (not that that will help your problem at all)
Let me try it in 5.0 and I'm curious as to what happens if I get several of these running becuase I don't clear events. Can you see your program running in the task manager?
>I appreciate enormously the patience of all who have responded to my messages thus far, but I am afraid my explanation of the problem has been inadequate. So here’s my problem completely in a tiny application I’ve made just for testing it. It includes a MAIN.PRG file like this:
>
>DO FORM MYFORM
>READ EVENTS
>DO CLEANUP
>
>PROCEDURE CLEANUP
>CLEAR EVENTS
>CLOSE ALL
>
>a form, MYFORM with just one command button with THISFORM.RELEASE in the click event, and a ShowWindow value of 2, AS-TOP-LEVEL-FORM.
>
>and no table!
>
>I’ve included a config.fpw file in the project that says nothing but SCREEN=OFF
>
>I build an exe, run it, and before the form appears I get a white window with Visual FoxPro on the title bar and a few menu buttons for one or two seconds.
>
>I’ve tried running c:\myfolder\myprog.exe -T
>
>I’ve tried _screen.left = -5000 in the main file
>
>I’ve tried screen=off in a config.fpw
>
>Nothing works.
>
>Must I use the screen with its menu? And if so how do I control the look of the screen?
>
>Thank you again.