wince5.0 的重启以及待机后的叫起

来源:互联网 发布:网络水军价格 编辑:程序博客网 时间:2024/06/10 16:23

 SetSystemPowerState( NULL , POWER_STATE_RESET , POWER_FORCE ) ;
这个函数可以让机器reset
而在backlight 熄灭后的唤起则可用下面的函数
关于Suspend后也可以用此方法叫起~
void CAutoBackupApp::API_SetPowerStatus(BOOL fBacklightOn)
{
 // the name of the backlight device
 TCHAR tszBacklightName[] = TEXT("BKL1:");

 static HANDLE s_hBacklightReq = NULL;

 if (fBacklightOn)
 {
  if (NULL == s_hBacklightReq)
  {
   // Set the requirement that the backlight device must remain
   // in device state D0 (full power)
   s_hBacklightReq = SetPowerRequirement(tszBacklightName, D0,
    POWER_NAME, NULL, 0);
   if (!s_hBacklightReq)
   {
    RETAILMSG(1, (L"SetPowerRequirement failed: %X/n",
     GetLastError()));
   }
  }
 }
 else
 {
  if (s_hBacklightReq)
  {
//释放Requirement
   if (ERROR_SUCCESS != ReleasePowerRequirement(s_hBacklightReq))
   {
    RETAILMSG(1, (L"ReleasePowerRequirement failed: %X/n",
     GetLastError()));
   }
   s_hBacklightReq = NULL;
  }
 }
}

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/leimiaomiao/archive/2007/06/07/1642643.aspx