• 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: Starting the screensaver from code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Starting the screensaver from code


  • Subject: Re: Starting the screensaver from code
  • From: Eric Peyton <email@hidden>
  • Date: Tue, 11 Dec 2001 08:42:51 -0600

On Tuesday, December 11, 2001, at 05:20 AM, Angela Brett wrote:

Hi,

Is there a way that my app can immediately start a screen saver, like System Preferences does when you press the 'Test' button? Starting any screensaver would be good, but I'm guessing it would be a lot simpler to somehow tell the system to run the screen saver that's currently selected. Is there an AppleEvent or Notification or something like that I could use?


There is no AppleEvent or Notification you can use, but you can still start it immediately ...

(Here comes one bad example for simplicities sake, please don't use system() in a shipping app use fork()/exec() or NSTask. The system call will NOT return until the app is done (i.e. the user clears the screensaver))

system("/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.
app/Contents/MacOS/ScreenSaverEngine");

Would do it ...

Eric


-- Angela Brett email@hidden http://acronyms.co.nz/angela
A mathematician is a machine for turning coffee into theorems -- Paul Erdos
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Starting the screensaver from code (From: Angela Brett <email@hidden>)

  • Prev by Date: Re: Damn sisters :-)
  • Next by Date: Re: Disable a menu (item)
  • Previous by thread: Starting the screensaver from code
  • Next by thread: Re: Starting the screensaver from code
  • Index(es):
    • Date
    • Thread