Board index » delphi » Trapping windows exit in a background application

Trapping windows exit in a background application

Hello,

I am new to windows programming and would like to know how to stop windows
3.11 from exiting to DOS without closing down my application.

My application has a buffer which is written to disk when the user exits
the program correctly.  However, if the user closes down windows, my
application doesn't write this buffer to disk.  I have been trying to use
the wm_QueryEndSession and wm_Quit messages but have not been very
successful.

The version of compiler i am using is Turbo Pascal 1.5 for windows.

Hoping to here from anybody

James

 

Re:Trapping windows exit in a background application


Quote
WaciBaci wrote:

> Hello,

> I am new to windows programming and would like to know how to stop windows
> 3.11 from exiting to DOS without closing down my application.

> My application has a buffer which is written to disk when the user exits
> the program correctly.  However, if the user closes down windows, my
> application doesn't write this buffer to disk.  I have been trying to use
> the wm_QueryEndSession and wm_Quit messages but have not been very
> successful.

> The version of compiler i am using is Turbo Pascal 1.5 for windows.

> Hoping to here from anybody

> James

You need to use the inherited function CanClose from the TWindow object,
to check if the buffer is written to disk, if not to write it
and then return True.

Hanan.

Other Threads