• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: send computer to sleep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >send computer to sleep (From: "Julian." <email@hidden>)

  • Prev by Date: Re: send computer to sleep
  • Next by Date: Re: PDFKit cpSelections?
  • Previous by thread: Re: send computer to sleep
  • Next by thread: selecting a row of a UITableView programatically
  • Index(es):
    • Date
    • Thread