简体   繁体   中英

Getting Shutdown/restart notification for Mac App

I am writing an Mac application and was wondering how I can get a notification if the user shuts down or restarts the computer. I have seen it in numerous applications such as Eclipse and Safari where if the shutdown is pressed, then the application will confirm if you want to close it and then if you click cancel, it can cancel the shutdown. I need to be able to basically allow the user to be reminded the application is running and prevent the shutdown if he chooses to continue with my application. Thank you so much!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM