Dmitry, I'm sorry to start the reply with another question, but if it's a one-form application, why is the _Screen visible in the first place?
The basic architecture of the single form applications I worked with is as follows:
1. In config.fpw,
SCREEN=OFF
2. In main.prg
DO FORM main.scx
IF TYPE("_Screen.ActiveForm") == "O"
READ EVENTS
ELSE
ENDIF
3. The main.scx has ShowWindow = 2 (Top Level form), and the code of its Destroy event, in essence, is just
CLEAR EVENTS
Does this make any sense to you?
>Hi,
>Another follow up to the question about a one-form application.
>I put the CLEAR EVENTS in the Unload method of the form. It works when I release the form first.
>But if, while the form is open, I click on the x (in the upper right corner; the _screen) the application wont close. I have to do it with the Task Manager.
>I added ON SHUTDOWN CLEAR EVENS right before the READ EVENTS line. But it does not do anything.
>My question:
>1. Can I disable (gray) the X in the upper right corner of the main window (_screen)?
>2. What else can I do to make the application close when user clicks on the x?
>
>TIA
----------------------------------
António Tavares Lopes