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