Board index » delphi » OnClose Event

OnClose Event

I have written an application which needs running at all time unless the
user decides to close it.
Using the Form.OnClose event I am able to display a MessageBox for
confirmation (e.g. Are you sure?).
Unfortunately, I cannot distinguish between the user closing the application
and a Windows shutdown and the MessageBox is displayed in both situations.
Ideally I would want to ask confirmation only when the user close the
application and not for a Windows shutdown.
Any idea on how I can do it?

Many thanks.

Roberto
robe...@zekland.demon.co.uk

 

Re:OnClose Event


  Look for a WM_ENDSESSION....  --  That's Windows shutting down....

--
Jason Wallace
SL Software          Bomb Tech:  If you see me running, try and keep up!"
Dark...@SLSoftware.reno.nv.us
Jason_Wall...@Intuit.com
--

Quote
Roberto Arnetoli <robe...@zekland.demon.co.uk> wrote in message

news:932059472.19481.0.nnrp-01.9e984c1b@news.demon.co.uk...
Quote
> I have written an application which needs running at all time unless the
> user decides to close it.
> Using the Form.OnClose event I am able to display a MessageBox for
> confirmation (e.g. Are you sure?).
> Unfortunately, I cannot distinguish between the user closing the
application
> and a Windows shutdown and the MessageBox is displayed in both situations.
> Ideally I would want to ask confirmation only when the user close the
> application and not for a Windows shutdown.
> Any idea on how I can do it?

> Many thanks.

> Roberto
> robe...@zekland.demon.co.uk

Other Threads