Check if shutdown is initiated or not

What is the win32 function to check if shutdown is initiated or not?

EDIT: I need to check this inside a windows service (COM). How to do it?

+5
source share
1 answer

There is no real Win32 function to verify this.

Instead, Windows sends a message to WM_QUERYENDSESSIONeach application when shutdown starts.

You can reply to this message and, for example, cancel the shutdown. (Although you should not do this if absolutely necessary)

A message is sent before the actual shutdown WM_ENDSESSION.

, , WM_QUERYENDSESSION.

EDIT: , .

, . , .

. MSDN .

+6

All Articles