问题
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