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 (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 arch...@mail-archive.com