时间不可控。。。
HANDLE hTimer;
hTimer=::CreateWaitableTimer(NULL,TRUE,"WaitForResume");
if(!hTimer)
{
MessageBox("Fail to create waitable timer!");
}
hTimer=OpenWaitableTimer(TIMER_ALL_ACCESS,TRUE,"WaitForResume");
LARGE_INTEGER liDueTime;
liDueTime.QuadPart=(Current_Plan.Sleep_time-Current_Plan.Wait_time)*1000*1000*(-10);//指定几秒钟唤醒
if(!::SetWaitableTimer(hTimer,&liDueTime,0,NULL,NULL,TRUE))
{
MessageBox("Fail to set waitable timer!");
}
想经过设定的时间让某个程序执行:具体是我将进入待机的系统设定上面设定的时间自己起来,从而进入休眠或关机;
短时间的设定是有效的,最长时间间隔为3分钟,为什么时间一长就无效呢?还请各位指点。。。