site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com void myPowerDownCallback(void *refcon, io_service_t service, uint32_t messageType, void *messageArgument ) { DLog(@"System shutdown message!"); [gDaemon systemWillPowerOff]; } // myPowerDownCallback // from my initialization code { ... IONotificationPortRef thePortRef; io_object_t notifier; io_connect_t c = IORegisterForSystemPower(NULL, &thePortRef, myPowerDownCallback, ¬ifier ); } Thanks, Matt _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I'm sorry for having to ask a noob question. I posted this to the Darwin user list last week but didn't get any replies. I have a Cocoa daemon that needs to monitor system events and relay them to a server. Using NSWorkspace notification I get sleep and wake messages but I can't seem to get the power down notification. So, other cocoa developers pointed me to using IOKit. I tried this from my daemon I don't think the callback gets called. I suppose that it could be interrupted before it can send its message but I really don't think I'm getting the callback. I'm a complete noob with it comes to IOKit. Can someone tell me where I'm going wrong ? This email sent to site_archiver@lists.apple.com
participants (1)
-
Matthew Mashyna