阻止窗口关闭
我需要在每次 Windows 关闭过程之前执行一些代码。所以,我想阻止 Windows 关闭过程一段时间。我如何从 Java 或 C++ Builder 中做到这一点?
谢谢。
I need execute some code before Windows shutdown process each time. So, I want block Windows shutdown process for some time. How can i do it from Java or C++ Builder ?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用注销或关闭脚本启动exe?这可以通过组策略来设置。
当然,我希望你有充分的理由(比如我的公司建设)这样做。正如评论中提到的,您想做什么?
Use a logoff or shutdown script to launch an exe? This can be set by Group Policy.
Of course, I hope you have a good reason (like my corporate build) to do this. As mentioned in comments, what are you tring to do please?
请参阅 WM_POWERBROADCAST 消息的响应。还要考虑到您防止关闭的能力可能取决于操作系统(似乎在 Vista 和更高版本上有附加功能)。
See response on WM_POWERBROADCAST message. Also take into account that your ability to prevent shut down can depends on OS (it seems on Vista and later there are additional capabilities).