Board index » delphi » End of program from user vs windows

End of program from user vs windows

Hello,

Does anybody know a way to make a difference between an end of application
from user or from Windows closing ?

In the first case, if the user clicks on Exit, I want to ask for a
confirmation before closing.

But if Windows is closing itself and so closes running applications, I don't
want to ask for a confirmation.

Thank you for any idea.

Denis

 

Re:End of program from user vs windows


If Windows closes you will receive a WM_QUERYENDSESSION and a WM_ENDSESSION
message, which you won't get if the user closes the application.

"Denis Fourr" <Den...@citeweb.net> schreef in bericht
news:9hruh6$edn$2@wanadoo.fr...

Quote
> Hello,

> Does anybody know a way to make a difference between an end of application
> from user or from Windows closing ?

> In the first case, if the user clicks on Exit, I want to ask for a
> confirmation before closing.

> But if Windows is closing itself and so closes running applications, I
don't
> want to ask for a confirmation.

> Thank you for any idea.

> Denis

Re:End of program from user vs windows


Hello, "Denis Fourr" <Den...@citeweb.net>! You wrote:
Quote
> Hello,

> Does anybody know a way to make a difference between an end of application
> from user or from Windows closing ?

> In the first case, if the user clicks on Exit, I want to ask for a
> confirmation before closing.

> But if Windows is closing itself and so closes running applications, I
don't
> want to ask for a confirmation.

    See about WM_QUERYENDSESSION API message.

--
    Evgeny V. Levashov, software developer,
    ICQ UIN 34864288
    Mebel Massiv Co, Tula, Russia
    http://home.tula.net/mebelmassiv

Other Threads