Block windows shutdown

感情迁移 提交于 2019-12-10 18:08:11

问题


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.


回答1:


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?




回答2:


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).



来源:https://stackoverflow.com/questions/2487185/block-windows-shutdown

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!