Disable Windows System Shutdown

Source: Internet
Author: User

Create an MFCProgramTo intercept the wm_queryendsession message and respond to on_wm_queryendsession (). The message response function corresponds to afx_msg bool onqueryendsession (). If you return false directly in this function, Windows wm_queryendsession requests are rejected, windows cannot be shut down normally. (Start> shut down the computer> shut down, log off, and restart ).

 When Windows is shut down, it will broadcast a message wm_queryendsession to all top-level windows. Instead of all processes, it should have registered window-class programs. Therefore, the console program does not receive the wm_queryendsession message.

 

Principle: http://blog.csdn.net/syf442/archive/2009/07/24/4373145.aspx

 

Post: https://www.xfocus.net/bbs/index.php? Act = sT & F = 3 & t = 43927 & page = all

 

There is no way to stop the Shutdown Process of the console program:

 

Http://blog.csdn.net/syf442/archive/2009/07/28/4387132.aspx

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.