在vc下,用哪个函数可以检测到关机信号????当关机信号给出时,用vc下函数如何检测到,该怎么操作???

解决方案 »

  1.   

    Receiving Shutdown Notification
    Applications with a window and message queue receive shutdown notification through the WM_QUERYENDSESSION message. Console applications receive shutdown notification in their handler routines. To register a console handler, use the SetConsoleCtrlHandler function. Service applications receive shutdown notification in their handler routines. To register a service control handler, use the RegisterServiceCtrlHandlerEx function
      

  2.   

    在  Application中,当注销,和重启是也发出这个信号,那该怎么区别??
    各位朋友,请给答复!?
      

  3.   

    在  Application中,当注销,和重启是也发出这个信号(WM_QUERYENDSESSION ),那该怎么区别??
    各位朋友,请给答复!?
      

  4.   

    用MFC的响应windows的消息来响应这一消息!!!
      

  5.   

    这是我用SDK写的,放在WndProc中:case WM_QUERYENDSESSION:
         if(lParam & ENDSESSION_LOGOFF)
    //注销
         else
    //关机和重启我还不知道怎么区分
    break;
      

  6.   

    WM_ENDSESSION
    WM_QUERYENDSESSION
    是这两个吧??