home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / os2 / programm / 7325 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.7 KB

  1. Path: sparky!uunet!usc!sdd.hp.com!swrinde!gatech!rutgers!cmcl2!panix!os2man
  2. From: os2man@panix.com (Larry Salomon Jr.)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Why WinCancelShutdown()?
  5. Message-ID: <C0Dv3o.304@panix.com>
  6. Date: 5 Jan 93 13:35:48 GMT
  7. Organization: PANIX Public Access Unix, NYC
  8. Lines: 29
  9.  
  10. Okay, everyone, due to the number of requests for this, I have decided to
  11. post it instead.  Also, because I received this explanation some time ago,
  12. my memory has since gone slightly hazy so some things might not seem 
  13. entirely logical.
  14.  
  15. According to the docs, WinCancelShutdown(hmq,TRUE) prevents the system from
  16. sending a WM_QUIT to that queue when the system is being shutdown.  What
  17. happens is that the system sends each queue this message and waits for the
  18. "queue" to respond (i.e. destroy itself) before continuing with the next queue.
  19. It can sort of be deduced that the main thread of each application receives
  20. this first.
  21.  
  22. Since the majority of secondary threads only have a message so that they can
  23. call the PM functions which require it (e.g. WinSendMsg), they never "see"
  24. this message and thus will never destroy themselves when it is sent.  For
  25. most applications, this is not a problem as the first thread will usually
  26. drop out of its message loop and kill the entire application; however, some
  27. applications do not do this which, in effect, stops the system shutdown from
  28. completing.
  29.  
  30. Obviously, it will probably not hurt you to not call this function from your
  31. other threads, but it is only good to get in the practice of doing so.
  32.  
  33. Cheers,
  34. Q
  35. -- 
  36. "If you choose not to decide, you  | "My other body is in the shop" - seen
  37.  still have made a choice" - Rush  |  on a T-shirt
  38. ------------------------------------------------------------------------
  39.