🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #3273

Why WinCancelShutdown()?

#3273
From: Larry Salomon Jr.
Date: Tue, 05 Jan 1993 13:35
29 lines
1803 bytes
Okay, everyone, due to the number of requests for this, I have decided to
post it instead.  Also, because I received this explanation some time ago,
my memory has since gone slightly hazy so some things might not seem 
entirely logical.

According to the docs, WinCancelShutdown(hmq,TRUE) prevents the system from
sending a WM_QUIT to that queue when the system is being shutdown.  What
happens is that the system sends each queue this message and waits for the
"queue" to respond (i.e. destroy itself) before continuing with the next queue.
It can sort of be deduced that the main thread of each application receives
this first.

Since the majority of secondary threads only have a message so that they can
call the PM functions which require it (e.g. WinSendMsg), they never "see"
this message and thus will never destroy themselves when it is sent.  For
most applications, this is not a problem as the first thread will usually
drop out of its message loop and kill the entire application; however, some
applications do not do this which, in effect, stops the system shutdown from
completing.

Obviously, it will probably not hurt you to not call this function from your
other threads, but it is only good to get in the practice of doing so.

Cheers,
Q
-- 
"If you choose not to decide, you  | "My other body is in the shop" - seen
 still have made a choice" - Rush  |  on a T-shirt
------------------------------------------------------------------------
Technical Details
Message-ID: <C0Dv3o.304@panix.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!swrinde!gatech!rutgers!cmcl2!panix!os2man

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!swrinde!gatech!rutgers!cmcl2!panix!os2man
From: os2man@panix.com (Larry Salomon Jr.)
Newsgroups: comp.os.os2.programmer
Subject: Why WinCancelShutdown()?
Message-ID: <C0Dv3o.304@panix.com>
Date: 5 Jan 93 13:35:48 GMT
Organization: PANIX Public Access Unix, NYC
Lines: 29