Einzelnen Beitrag anzeigen

Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#10

AW: Anwendung beenden bei Windows Shutdown (WM_QueryEndSession)

  Alt 4. Apr 2014, 08:49
Es bleibt die Frage zu klären, wann eine Anwendung als hängend gilt. Wenn die Anwendung korrekt auf die Nachrichten innerhalb der vorgegebenen Zeitfenster die Rückmeldungen gibt, dann hängt diese eben nicht.
  • Application shutdown procedure in a non-critical shutdown
    MessageVisible top-level window or reason string specifiedNo visible top-level window and no reason string specified
    WM_QUERYENDSESSIONApplication can take as much time as needed to respond to WM_QUERYENDSESSION. Windows displays new UI after 5 seconds.Application has 5 seconds to respond to WM_QUERYENDSESSION, and then Windows terminates the application if the application is unresponsive.
    WM_QUERYENDSESSIONWindows displays new UI if the application responds FALSE to WM_QUERYENDSESSION.Windows sends WM_ENDSESSION message to the application if the application responds FALSE to WM_QUERYENDSESSION.
    WM_ENDSESSIONApplication can take as much time as needed to respond to WM_ENDSESSION. Windows displays new UI after 5 seconds.Application has 5 seconds to respond to WM_ENDSESSION, and then Windows terminates the application if the application is unresponsive.
  • Application shutdown procedure in a critical shutdown
    MessageVisible top-level window or reason string specifiedNo visible top-level window and no reason string specified
    WM_QUERYENDSESSIONApplication has 1 second to respond to WM_QUERYENDSESSION, and then Windows terminates the application if the application is unresponsive.Application has 1 second to respond to WM_QUERYENDSESSION, and then Windows terminates the application if the application is unresponsive.
    WM_QUERYENDSESSIONIf the application responds FALSE to WM_QUERYENDSESSION, Windows sends WM_ENDSESSION message to the application.If the application responds FALSE to WM_QUERYENDSESSION, Windows sends WM_ENDSESSION message to the application.
    WM_ENDSESSIONApplication has 30 seconds to respond to WM_ENDSESSION, and then Windows terminates the application if the application is unresponsive.Application has 5 seconds to respond to WM_ENDSESSION, and then Windows terminates the application if the application is unresponsive.
Der Benutzer kann das Herunterfahren aber immer noch provozieren (egal welche Meldungen man an das System abgegeben hat), denn der soll entscheiden.

MSDN-Library durchsuchenShutdownBlockReasonCreate
Zitat:
Because users are typically in a hurry when shutting down the system, they may spend only a few seconds looking at the shutdown reasons that are displayed by the system. Therefore, it is important that your reason strings are short and clear. For example "A CD burn is in progress." is better than "This application is blocking system shutdown because a CD burn is in progress. Do not shut down."
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat