Re: send computer to sleep
Re: send computer to sleep
- Subject: Re: send computer to sleep
- From: Jean-Daniel Dupas <email@hidden>
- Date: Wed, 26 May 2010 23:24:13 +0200
Le 26 mai 2010 à 23:01, Julian. a écrit :
> what is the correct way to send the computer to sleep? i couldn't find anything in the documentation, except appleevents...
#include <IOKit/pwr_mgt/IOPMLib.h>
void SystemSleep() {
io_connect_t port = IOPMFindPowerManagement(MACH_PORT_NULL);
IOPMSleepSystem(port);
IOServiceClose(port);
}
Note that I didn't know this method before I try typing sleep in the Xcode reference search field (just after reading your question).
-- Jean-Daniel
_______________________________________________
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