Re: About OS Shutting down / Restarting
Re: About OS Shutting down / Restarting
- Subject: Re: About OS Shutting down / Restarting
- From: "Maggie Zhang" <email@hidden>
- Date: Thu, 6 Nov 2008 13:11:49 -0800
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@hidden> 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 (email@hidden)
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:
This email sent to email@hidden