Hi, I've got an unit which will be added to other my applications. And I've got a problem.
In certain moment I must close application, but I have to be sure that code included in OnClose event will be executed.
Another problem is that some applications will have OnCloseQuery event, and some not.
As far as I know, I can't use Application.Terminate nor Halt, because code in OnClose will not be executed.
Application.MainForm.Close; can't be used as well, because if there is OnCloseQuery event, application will not close.
So, how to close application and execute code in OnClose(if there is any)?
Maybe something with compiler directives? But what?
In certain moment I must close application, but I have to be sure that code included in OnClose event will be executed.
Another problem is that some applications will have OnCloseQuery event, and some not.
As far as I know, I can't use Application.Terminate nor Halt, because code in OnClose will not be executed.
Application.MainForm.Close; can't be used as well, because if there is OnCloseQuery event, application will not close.
So, how to close application and execute code in OnClose(if there is any)?
Maybe something with compiler directives? But what?