简体   繁体   English

获取Mac App的关机/重新启动通知

[英]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. 我正在编写Mac应用程序,想知道如果用户关闭或重新启动计算机时如何获得通知。 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. 我已经在Eclipse和Safari等众多应用程序中看到了它,如果按下关闭按钮,则该应用程序将确认您是否要关闭它,然后单击“取消”,它可以取消关闭。 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!! 非常感谢!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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