GetSystemPowerState Output not defined in pm.h

陌路散爱 提交于 2019-12-11 11:56:47

问题


I am trying to get the user idle state of my Windows Mobile device.

When I run the function GetSystemPowerState (after 15 min of not touching the device) I get the following value:

Dec: 302055424
Hex: 0x12010000
Bin: 10010000000010000000000000000

I was hoping that PowerState & POWER_STATE_USERIDLE == POWER_STATE_USERIDLE would be true. But POWER_STATE_USERIDLE is 0x01000000 and I have 0x02000000.

I went to look up 0x02000000 and found that it is not in pm.h.

What does 0x02000000 mean? Where could I go to find out?


回答1:


According to pm.h (found in %WINCEROOT%\PUBLIC\COMMON\SDK\INC)

#define POWER_STATE(f)           ((f) &  0xFFFF0000) // power state mask
#define POWER_STATE_ON           (DWORD)(0x00010000) // on state
#define POWER_STATE_OFF          (DWORD)(0x00020000) // no power, full off
#define POWER_STATE_CRITICAL     (DWORD)(0x00040000) // critical off
#define POWER_STATE_BOOT         (DWORD)(0x00080000) // boot state
#define POWER_STATE_IDLE         (DWORD)(0x00100000) // idle state
#define POWER_STATE_SUSPEND      (DWORD)(0x00200000) // suspend state
#define POWER_STATE_UNATTENDED   (DWORD)(0x00400000) // Unattended state.
#define POWER_STATE_RESET        (DWORD)(0x00800000) // reset state
#define POWER_STATE_USERIDLE     (DWORD)(0x01000000) // user idle state
#define POWER_STATE_BACKLIGHTON  (DWORD)(0x02000000) // device scree backlight on
#define POWER_STATE_PASSWORD     (DWORD)(0x10000000) // This state is password protected.

So it looks to me like you have the following:

POWER_STATE_ON | POWER_STATE_BACKLIGHTON | POWER_STATE_PASSWORD



来源:https://stackoverflow.com/questions/3000478/getsystempowerstate-output-not-defined-in-pm-h

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!