如果电脑进入待机(挂起)或休眠状态时可否用程序在特定时间唤醒它?

解决方案 »

  1.   

    http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=187906
      

  2.   

    http://blog.csdn.net/amh/archive/2005/01/01/236765.aspx
    http://www.enet.com.cn/eschool/inforcenter/A20040325297428.html
      

  3.   

    在程序让系统进入S3或S4之前,或程序收到系统suspend消息时,加上这样一段:
    HANDLE hTimer=::CreateWaitableTimer(NULL,TRUE,"WaitForResume");
    if(!hTimer)
    {
    MessageBox("Fail to create waitable timer!");
    //break;
    }
    hTimer=OpenWaitableTimer(TIMER_ALL_ACCESS,TRUE,"WaitForResume");
    LARGE_INTEGER liDueTime;
    liDueTime.QuadPart=nSecond*1000*1000*(-10);  //nSecond指定几秒钟唤醒
    if(!::SetWaitableTimer(hTimer,&liDueTime,0,NULL,NULL,TRUE))
    {
    MessageBox("Fail to set waitable timer!");
    break;
    }