My notes say that there is a way to do this using an undocumented class, ScreenSaverController . Here is the title:
@interface ScreenSaverController : NSObject { void *_reserved; } + (id)controller; + (id)enginePath; - (id)init; - (void)dealloc; - (BOOL)screenSaverIsRunning; - (BOOL)screenSaverCanRun; - (void)setScreenSaverCanRun:(BOOL)arg1; - (void)screenSaverStartNow; - (void)screenSaverStopNow; - (void)restartForUser:(id)arg1; - (double)screenSaverTimeRemaining; - (BOOL)screenSaverIsRunningInBackground; - (void)screenSaverDidFadeInBackground:(BOOL)arg1 psnHi:(unsigned int)arg2 psnLow:(unsigned int)arg3; @end
And here is how to use it:
ScreenSaverController *ssc = [ScreenSaverController controller]; if ([ssc screenSaverCanRun]) { ... } [ssc release];
Note that to use it, you will need to bind the ScreenSaver structure. Since this is an undocumented class, this will make your application inappropriate for the Mac App Store.
Also take a look at screenSaverTimeRemaining - some ways to prevent the splash screen from starting may just be reset.
source share