Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DeDMakar

macrumors member
Original poster
Mar 24, 2008
39
0
Hi,
Is there a way that my application can immediately start to work when will stop screensaver.
Is there an Event or Notification or something like that I could use?
I need to define that moment when it is necessary to enter the passport and user.
 
Assuming those notifications are correct and they're still being sent in Leopard (can't test right now), you would need to do this:

Code:
- (id)init {
    self = [super init];
    [[NSDistributedNotificationCenter defaultCenter] addObserver:self
        selector:@selector(screenSaverDidStop:)
        name:@"com.apple.screensaver.didstop" object:nil];
    return self;
}

- (void)screenSaverDidStop:(NSNotification *)notification {
    // do something here
}

Edit: if you're not using Cocoa you can use CFNotificationCenterGetDistributedCenter() and related functions instead.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.