检测到应用程序关闭时关闭PC [英] Shutdown PC on detection of an application close

查看:146
本文介绍了检测到应用程序关闭时关闭PC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用Application :: ApplicationExit Event导致计算机关闭,如果有人退出像Sticky Notes这样的应用程序。在这里有人可以提供一些关于我如何做到这一点的示例代码吗?非常基本的编码知识。感谢您的帮助。



我的尝试:



我我曾尝试使用Visual Studio Code来获得粗略的草图,但这完全是我的想法。

I'm wondering if I can use Application::ApplicationExit Event to cause my computer to shutdown if someone exits out of an app like Sticky Notes. Is here someone who could maybe provide some sample code on how I could do this? Very basic knowledge of coding. Your help is appreciated.

What I have tried:

I've tried to use Visual Studio Code to get a rough sketch, but this is all over my head.

推荐答案

没有。

Application.ApplicationExit事件仅在当前应用程序退出时触发,而不是在关闭其他应用程序时触发。

有可能检测到其他应用程序何时关闭,但正如Richard已经说过您要尝试的内容听起来像恶意软件;很难想到这样做的正当理由。

我们不会宽恕,支持或协助以任何方式,形式或方式生成恶意代码。这是专业开发人员的专业网站。
No.
The Application.ApplicationExit Event only fires when the current application is exiting, not when a different application is closed.
It is possible to detect when a different app closes, but as Richard has said what you are trying to do sounds like malware; it's difficult to think of a legitimate reason for doing this.
And we do not condone, support, or assist in the production of malicious code in any way, form, or manner. This is a professional site for professional developers.


这篇关于检测到应用程序关闭时关闭PC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆