function cancels a request for an application to [[shutdown|shut down]].
#define INCL_WINMESSAGEMGR /* Or use INCL_WIN, INCL_PM, Also in COMMON section */
HMQ hmq; /* Handle of message queue for current thread. */
BOOL fCancelAlways; /* Cancellation control. */
BOOL rc; /* Success indicator. */
rc = WinCancelShutdown(hmq, fCancelAlways);
hmq (HMQ) - input. Handle of message queue for current thread.
fCancelAlways (BOOL) - input. Cancellation control.
TRUE No WM_QUIT message should be placed on this queue during system shutdown.
FALSE The applications ignore any outstanding WM_QUIT messages already sent to it, but a message should be sent during other system shutdowns.
rc (BOOL) Success indicator.
TRUE Successful completion
FALSE Error occurred.
On a system shutdown, each message queue is normally posted a WM_QUIT message. An application can handle this message in one of two ways:
Either way the system can proceed to the next queue.
If the application determines that it never wants a message queue to receive a [[WM_QUIT]] message as a result of a system shutdown, it should call WinCancelShutdown (hmq, TRUE), typically right after creating the message queue.
- Destroy its message queue using [[WinDestroyMsgQueue]] (hmq) or,
- Call [[WinCancelShutdown]](hmq, FALSE)