2.可以通过响应一个消息,好像是叫QUERY_CLOSE什么的,来延迟系统关闭。
但是用户还是可以选择kill掉你的3个进程

解决方案 »

  1.   

    2:System Shutdown Functions
    The following functions are used with system shutdown. Function Description 
    AbortSystemShutdown Stops a system shutdown started by using the InitiateSystemShutdown function. 
    ExitWindows Logs off the current user. 
    ExitWindowsEx Either logs off the current user, shuts down the system, or shuts down and restarts the system. 
    InitiateSystemShutdown Initiates a shutdown and optional restart of the specified computer. 
    InitiateSystemShutdownEx Initiates a shutdown and optional restart of the specified computer. 
    LockWorkStation Locks the workstation's display, protecting it from unauthorized  
      

  2.   

    是WM_QUERYENDSESSION靠!一不做,二不休,接着贴!Power Management Functions
    The following functions are used with power management.Function Description 
    GetDevicePowerState Retrieves the current power state of the specified device. 
    GetSystemPowerStatus Retrieves the power status of the system. 
    IsSystemResumeAutomatic Indicates the current state of the computer. 
    RequestWakeupLatency Specifies roughly how quickly the computer should enter the working state. 
    SetSystemPowerState Suspends the system by shutting power down. 
    SetThreadExecutionState Enables applications to inform