whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews
 misc ¦  tutorials ¦  Add&Win Game

Tips (1541)

Database (90)
Files (137)
Forms (107)
Graphic (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Math (76)
Misc (126)
Multimedia (45)
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (266)
VCL (242)


Tips sort by

Search Tip

Add new Tip

Add&Win Game


27 Visitors Online

...Prevent Windows Shut Down?
Autor: Thomas Stutz
[ Print tip ]  

Tip Rating (15):  


The WM_QUERYENDSESSION message is sent to all applications
when the user chooses to end the session or when an application calls the
ExitWindows function.
If any application returns zero, the session is not ended.
The system stops sending WM_QUERYENDSESSION messages as soon as one application
returns zero.
After processing this message, the system sends the WM_ENDSESSION message with the
wParam parameter set to the results of the WM_QUERYENDSESSION message.


Windows sendet die WM_QUERYENDSESSION Nachricht an alle laufenden Anwendungen
und wartet auf deren Antwort.
Wenn irgendeine Anwendungen 0 zurückgibt endet die Session nicht ansonsten
sendet Windows eine WM_ENDSESSION Nachricht an alle Anwendungen.
Jede Anwendung, die darauf mit TRUE antwortet,
kann jederzeit von Windows beendet werden.

Windows NT/2000/XP: When an application returns TRUE for this message,
it receives the WM_ENDSESSION message and it is terminated,
regardless of how the other applications respond to the WM_QUERYENDSESSION message.

Windows 95/98/Me: After all applications return TRUE for this message,
they receive the WM_ENDSESSION and they are terminated.

  procedure WMQueryEndSession (var Msg : TWMQueryEndSession); message WM_QueryEndSession;


 TForm1.WMQueryEndSession (var Msg : TWMQueryEndSession);
  if MessageDlg('Close Windows now/ Windows beenden?',
                            [mbYes,mbNo], 0) = mrNo then
      Msg.Result := 0
      Msg.Result := 1;


Rate this tip:

very good

Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners