mobile,ppc,wince防止自动挂起
为了省电,Mobile,PPC,WinCE等PDA会在系统闲置一段时间后,会自动作挂起的动作。
为防止机器做自动挂起的动作,可以注册表修改如下:

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\Timeouts]
"BattSuspendTimeout"=dword:00000000


这里需要注意的是,修改了此注册表选项后,系统不会马上起作用。需要对机器作一次 Warm boot 的动作。

如果不想做 Warm boot 的动作,那么需要用如下的代码去更新:

// Tell power manager to reload the registry timeouts
HANDLE hevReloadActivityTimeouts =
    OpenEvent(EVENT_ALL_ACCESS, FALSE, _T("PowerManager/ReloadActivityTimeouts"));
if (hevReloadActivityTimeouts)
{
    SetEvent(hevReloadActivityTimeouts);
    CloseHandle(hevReloadActivityTimeouts);
}


相关文章:

  • 2022-12-23
  • 2021-10-24
  • 2021-08-09
  • 2022-01-13
  • 2021-05-10
  • 2022-12-23
  • 2021-12-08
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2021-12-11
  • 2021-12-25
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案