home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / os2 / programm / 4327 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.7 KB  |  33 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!stanford.edu!ames!pacbell.com!well!shiva
  3. From: shiva@well.sf.ca.us (Kenneth Porter)
  4. Subject: WP Shell & Shutdown API questions
  5. Message-ID: <Bt8yyt.For@well.sf.ca.us>
  6. Sender: news@well.sf.ca.us
  7. Organization: Whole Earth 'Lectronic Link
  8. Distribution: comp
  9. Date: Wed, 19 Aug 1992 20:16:04 GMT
  10. Lines: 21
  11.  
  12. I want to create a shutdown object that simply tells the desktop
  13. to do whatever it would do when the shutdown menuitem is selected.
  14. In other words, I want the object to act like a virtual user that
  15. activates the menu of another object. How is this done? Relevant
  16. manual references would be welcome.
  17.  
  18. Meanwhile, I whipped out a short program that uses WinShutdownSystem()
  19. to bring the system down.  I keep a flag in os2.ini to keep track of
  20. whether the program is being called during startup as a result of being
  21. around when the system was going down.  This keeps the shutdown from
  22. happening again as the system comes up.  It seems to work well provided
  23. that one allows all processes to die when asked.  If, for example, an
  24. OS/2 Window session is running, one gets a requestor asking whether one
  25. wants to lose the data in the session.  If you answer no,
  26. WinShutdownSystem seems to hang (I think, since I haven't single-stepped
  27. it to see if it dies after returning).  The icon stays "slashed" and
  28. pstat shows the process blocked.  I am able to kill the process, though.
  29. I thought that WinShutdownSystem should return with an error code. I'm
  30. not really sure what I'm supposed to do after the call returns, anyway. 
  31. Should I do the normal WinDestroyMsgQueue/WinTerminate, or just a
  32. DosExit (this is what I have now), or DosSleep(FOREVER), or what?
  33.