我的程序需要阻止系统关机,请问如何实现?

解决方案 »

  1.   

    只是普通的应用mfc程序,但是希望能收到系统关机时候发来的通知。
    就像ultraedit做的那样。
      

  2.   

    关机命令:
    BOOL ExitWindowsEx(
      UINT uFlags,       // shutdown operation
      DWORD dwReserved   // reserved
    );如何禁止关机,不清楚。等待...
    帮定..
      

  3.   

    blogs.msdn.com/oldnewthing/ archive/2004/07/22/191123.aspx
      

  4.   

    http://blog.csdn.net/bestbear/articles/73424.aspx
      

  5.   

    The framework calls this member function when the user chooses to end the Windows session or when an application calls the ExitWindows Windows function.afx_msg BOOL OnQueryEndSession( );
    在你的主框架类中响应消息OnQueryEndSession,若你在阻止关机则在该消息处理函数中返回FALSE.