Board index » delphi » Detect Windows Shutdown

Detect Windows Shutdown

hi,

How can I detect in my app that Windows is shuting down, restarting or
loging off?

I have to know this, because I havet to terminate my some actions
manually.For instance unsaved files.

thannks.

 

Re:Detect Windows Shutdown


Quote
"Kursad SIRIN" <ksi...@lodos.com> wrote:
>How can I detect in my app that Windows is shuting down, restarting or
>loging off?

>I have to know this, because I havet to terminate my some actions
>manually.For instance unsaved files.

Your main window will first receive a WM_QUERYENDSESSION message. If
you return 0, the shut down is aborted. If you return a non-zero
value, you will later receive a WM_ENDSESSION message. You can save
your files at either point.

Good luck.

Kurt

Re:Detect Windows Shutdown


Quote
In article <3d85e...@newsgroups.borland.com>, Kursad SIRIN wrote:
> How can I detect in my app that Windows is shuting down, restarting or
> loging off?

The main forms OnCloseQuery event will fire in these situations, same as
when the user tries to close the form.

--
Peter Below (TeamB)  
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Other Threads