pm.h中未定义的GetSystemPowerState输出 [英] GetSystemPowerState Output not defined in pm.h
问题描述
我正在尝试使Windows Mobile设备的用户处于空闲状态.
I am trying to get the user idle state of my Windows Mobile device.
运行时该功能 GetSystemPowerState (未触摸设备15分钟后),我得到了以下值:
When I run the function GetSystemPowerState (after 15 min of not touching the device) I get the following value:
十二月: 302055424
十六进制: 0x12010000
bin: 10010000000010000000000000000
Dec: 302055424
Hex: 0x12010000
Bin: 10010000000010000000000000000
我希望 PowerState&POWER_STATE_USERIDLE == POWER_STATE_USERIDLE
为true.但是POWER_STATE_USERIDLE是0x01000000,我有0x02000000.
I was hoping that PowerState & POWER_STATE_USERIDLE == POWER_STATE_USERIDLE
would be true. But POWER_STATE_USERIDLE is 0x01000000 and I have 0x02000000.
我去查找0x02000000,发现它不在pm.h中.
I went to look up 0x02000000 and found that it is not in pm.h.
0x02000000是什么意思?我在哪里可以找到答案?
What does 0x02000000 mean? Where could I go to find out?
推荐答案
根据pm.h(位于%WINCEROOT%\ PUBLIC \ COMMON \ SDK \ INC
中)
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
这篇关于pm.h中未定义的GetSystemPowerState输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!