在 Windows CE 中打开背光
有没有其他方法可以在 Windows CE 中打开背光?目前,我正在设置事件“PowerManager/ActivityTimer/UserActivity”,最终使背光保持打开状态。我还想监视用户在设备上是否有触摸等活动。如果用户在指定时间内没有任何活动,我想执行特定于应用程序的注销。由于我们想保留背光,因此我们手动设置上述事件,但现在它造成了测量实际用户活动的问题。
有什么解决办法吗?
谢谢, 奥姆基
Is there any other way to turn ON the backlight in Windows CE?? Presently I am setting the event "PowerManager/ActivityTimer/UserActivity" which eventually keeps back light ON. I also want to monitor if there is activity on device like touch etc by user. If there is no activity by the user for specified time, I want to do a application specific log off. Since we want to keep the back light we are setting above event manually but now it is creating the problem to measure actual user activity.
Is there any solution?
Thanks,
Omky
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个设备都有自己特定的背光驱动程序,可能通过 DeviceIoControl 调用访问。然而,在我使用过的 CE 设备上,这些 API 并不打开背光,而是控制超时和强度设置。您或许可以使用 SetDevicePower() 或 SetPowerRequirement() API,尽管我从未使用过它们。
我使用“PowerManager/ActivityTimer/UserActivity”事件来触发背光打开。我相信 CE 通过鼠标和键盘活动设置了相同的事件。我尝试通过等待此事件来检测活动,但没有成功,但问题是不能保证您的线程在设置时会被调度。然后,您必须重新设置事件以触发正常的系统行为。
您可以捕获键盘活动 SetWindowHookEx,请参阅 http://www.codeproject.com/KB/windows /wincekbhook.aspx。代码项目网站上也有 C# 文章。注意,在 CE 设备上我只使用了一个可以设置的钩子,尽管在 WM 上我还没有找到这个。
我怀疑你也可以监听鼠标输入,我不知道如何。
Each device is going to have it's own specific driver for backlight, probably accessed by DeviceIoControl calls. On the CE devices I've worked with these APIs don't turn on the backlight however, but control timeout and intensity settings. You can probably use SetDevicePower() or SetPowerRequirement() APIs, though I've never used them.
I have used "PowerManager/ActivityTimer/UserActivity" event to trigger the backlight on. I believe CE sets this same event from mouse and keyboard activity. I have tried unsuccessfully to detect activity by waiting on this event, but the problem is there's no guarantee your thread will be scheduled when it is set. You then must re-set the event to trigger normal system behavior.
You can capture keyboard activity SetWindowHookEx, see http://www.codeproject.com/KB/windows/wincekbhook.aspx. There are C# articles on code project site as well. Note on CE devices I've used only a single hook can be set, though on WM I have not found this.
I would suspect you could snoop mouse input too, I'm not sure how.