Board index » delphi » Doing work at Shutdown in D4

Doing work at Shutdown in D4

I am writing an application of Win95/98/NT in Delphi 4 which needs to do
some work at Shutdown,
then close an allow the OS to continue with the Shutdown.

Any takers?

thanks Malcolm Edgar
mailto:ed...@ccis.adisys.com.au

 

Re:Doing work at Shutdown in D4


Use TForm.OnClose and make use of the CloseAction variable - hit F1 on the
Object Inspector with OnClose highlighted (in the Events list) to get help
on it. When the shutdown of the system occurs, windows asks all the
applications in turn if they can close. Each program can then take measures
to save work or say no to this, in which case the system wont shut down....
unless windows is in a bad mood (:

BLiTZ

Quote
Malcolm Edgar <ed...@ccis.adisys.com.au> wrote in message

news:387C1445.A91D44F@ccis.adisys.com.au...
Quote
> I am writing an application of Win95/98/NT in Delphi 4 which needs to do
> some work at Shutdown,
> then close an allow the OS to continue with the Shutdown.

> Any takers?

> thanks Malcolm Edgar
> mailto:ed...@ccis.adisys.com.au

Re:Doing work at Shutdown in D4


On Wed, 12 Jan 2000 13:42:29 +0800 Malcolm Edgar wrote:

Quote
> I am writing an application of Win95/98/NT in Delphi 4 which needs to do
> some work at Shutdown,
> then close an allow the OS to continue with the Shutdown.

> Any takers?

What about the OnClose or OnCloseQuery events?

Bye, Udo

Re:Doing work at Shutdown in D4


In article <387C1445.A91D...@ccis.adisys.com.au>, Malcolm Edgar

Quote
<ed...@ccis.adisys.com.au> writes:
>Subject:    Doing work at Shutdown in D4
>From:       Malcolm Edgar <ed...@ccis.adisys.com.au>
>Date:       Wed, 12 Jan 2000 13:42:29 +0800

>I am writing an application of Win95/98/NT in Delphi 4 which needs to do
>some work at Shutdown,
>then close an allow the OS to continue with the Shutdown.

>Any takers?

>thanks Malcolm Edgar
>mailto:ed...@ccis.adisys.com.au

Check out Delphi help 'Closing Applications' Exiting Gracefully. You should be
able to clean up after recieving the OnCloseQuery event.
HTH
Bob

Re:Doing work at Shutdown in D4


Quote
Bob Foley <rf...@cs.com> wrote in message

news:20000112064508.27270.00000223@nso-fl.news.cs.com...

Quote
> In article <387C1445.A91D...@ccis.adisys.com.au>, Malcolm Edgar
> <ed...@ccis.adisys.com.au> writes:
> >I am writing an application of Win95/98/NT in Delphi 4 which needs to do
> >some work at Shutdown,
> >then close an allow the OS to continue with the Shutdown.

> Check out Delphi help 'Closing Applications' Exiting Gracefully. You
should be
> able to clean up after recieving the OnCloseQuery event.

In addition to Bob's suggestion, you might want to add a handler for the
WM_QUERYENDSESSION message in case users try to shutdown Windows without
closing your app first.

procedure TForm1.WMQueryEndSession(var Message: TWMQueryEndSession);
begin
  Close;    // Call the application's Close method
  Message.Result := LongInt(True);
end;

--
Stephen Brown

Other Threads