【发布时间】:2010-06-18 16:54:35
【问题描述】:
我正在尝试获取我的 Windows 移动设备的电源状态。
状态为defined:
#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.
我得到 0x10010000。所以我设置了 POWER_STATE_ON 和 POWER_STATE_PASSWORD。
当我的设备进入空闲状态时我会收到此消息(我使用RequestPowerNotifications 来获取该通知)。你可以看到我使用的例子here。
由于它正在闲置,我相当确定还有更多我没有得到的信息。
所以我的问题是“我如何提供密码”?密码是什么? (我的代码在我公司拥有的 Symbol/Motorola 设备上运行,所以我应该能够获得密码,不管它是什么。)
我正在使用 C#、Visual Studio 2008 和 CF3.5。
任何帮助(关于这个问题)将是最......有帮助的。
【问题讨论】:
标签: windows-mobile compact-framework pinvoke