Thank you for your help, Jason. Our program will try to do the following things:
If restart is selected, our program will programatically restart the computer. If shutdown is selected, we will let the system shutdown in its own way. Therefore, we need to find a way to tell whether the computer is shutting down or restarting. Also, we need to deal with doing a shutdown or restart from the Apple Menu and from the command line. I noticed many people have asked similar questions before but none of the replies answered our questions. On Thu, Nov 6, 2008 at 12:20 PM, Jason Coco <[EMAIL PROTECTED]> wrote: > > On Nov 5, 2008, at 20:40 , Maggie Zhang wrote: > > Is there any Mac OS API that will tell whether the OS is shutting down or >> restarting? >> > > Yes, but it depends on what you want to do... the basic API is in the User > Space > portion of the IOKit Framework. See this tech q&a and the IOKit Framework > documentation > for more info: > > http://developer.apple.com/qa/qa2004/qa1340.html > http://developer.apple.com/documentation/Darwin/Reference/IOKit/index.html > > P.S. - the tech q&a is talking about registering for sleep/wake events but > the > process for shutdown events is the same so you can use it as a base > reference. > > J _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]