How to abort shutdown in Windows (XP|Vista) programatically?

前端 未结 2 1786
别那么骄傲
别那么骄傲 2020-12-06 07:02

I want to be able to 1. detect (and, if needed 2. abort) OS shutdown from my application, preferably by using the Windows API.

I know that it is possible to abort sh

2条回答
  •  孤城傲影
    2020-12-06 07:27

    In regards to 'simply' returning 0 to block a shutdown, it isn't as simple as that if you want to do it in the proper way. Especially on Vista. For example please also read http://msdn.microsoft.com/en-us/library/ms700677(VS.85).aspx

提交回复
热议问题