如何防止终端(Windows-CE)5分钟后关闭
如何防止终端(Windows-CE)在5分钟后关闭
终端是Motorola MC3190(Windows-CE),如果我5分钟没有触摸屏幕,
终端就会关闭。如何防止这种情况?
我需要 C# 代码中的解决方案。
提前致谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我最初投票结束,但一直在思考这个问题,我认为你提出的问题可能遗漏了一条重要的信息。
我认为您需要查看的是 Windows CE 电源管理功能,特别是 SetPowerRequirement< /a>.这允许您指示您的应用程序正在使用系统内的某些设备。如果不是,则不清楚为什么您的应用程序在缺少某些设备交互的情况下想要阻止电源管理完成其工作。
I initially voted to close, but have been thinking more about this, and I think the question you've asked may have been missing an important piece of information.
I think what you need to look at are the Windows CE Power Management functions, specifically SetPowerRequirement. This allows you to indicate that your application is using some device within the system. If not, it's unclear why your application, absent some device interactions, wants to prevent power management from doing its job.
不需要任何代码。转到“开始”->“设置”->“电源”,然后取消选中“如果设备不使用则关闭屏幕”旁边的框。
如果您尝试以编程方式执行此操作,则会比用户预期更快地耗尽电池电量。这可能会激怒您的用户。
如果您决心这样做,那么您可以修改 [HKLM] 中的值\System\CurrentControlSet\Control\Power\Timeouts
我也在MSDN 论坛
-PaulH
No code needed for this. Go to Start->Settings->Power and uncheck the box next to "Turn off screen if device not used for".
If you tried to do this programmatically, you would be draining the battery power faster than the user intends. That will probably irritate your user.
If your heart is set on doing this, then you can modify the value in [HKLM]\System\CurrentControlSet\Control\Power\Timeouts
I also gave this answer on the MSDN forums
-PaulH
我不知道 Windows-CE,也不知道 C#,但我在 google 上找到了答案。 给你。现在我想尝试为某个电台编程一些东西。将是很棒的家庭控制设备。
I dont know Windows-CE and i Dont know C#, but I found you an answer on google. Here you go. And now I want to try programing something for some station. Would be great home control device.
您的 Motorola MC3190 是否配置为在使用电池电源运行时关闭?如果使用外部电源,它会关闭吗?
注意: 我必须发布为显示图像的答案,但这不是并不是真正的答案。
编辑:如果这是您感兴趣的内容,请考虑阅读设备的系统状态 属性。 许多成员 系统状态,以及其中之一可能就是您所追求的。
对于您想要做的事情没有简单的技术,因为这些设备被设计为在不使用时断电。如果电池没电了,设备必须完全重置。 确保这是您想要做的事情,因为有一个很难绕过的原因。
您可能需要注册BatteryStrength 更改事件(例如 >> 这个 <<),然后尝试以某种方式欺骗它......也许通过弹出一个对话框或模拟按键。
您很可能需要 P/Invoke 一些较低级别的 coredll.dll 功能(示例 >> 这里 <<) 来获取您想要的内容,因为这些内容并未包含在标准 WinMobile SDK 中。
编辑2:这是一个很好的例子,有人写来读取和控制尽可能多的电源状态:techlicity 博客 我非常喜欢它,我已将代码复制到我的移动项目中的一个类中!
Is your Motorola MC3190 configured to Turn Off if it is running on Battery Power? Will it ever turn off if on External Power?
NOTE: I had to post as answer to show image, but this isn't really an answer.
EDIT: If this is what you are interested in, consider reading the device's SystemState property. There are many members to SystemState, and one of them just may be what you are after.
There is no easy technique for what you are wanting to do, because the devices are designed to power down when not in use. If the battery goes dead, the devices have to be completely reset. Make sure this is what you want to do, because there is a reason it is hard to get around.
You'll likely have to register for a BatteryStrength changed event (like >> THIS <<), then try to trick it somehow ...maybe by popping up a dialog box or simulating a key press.
You'll most likely need to P/Invoke some of the lower level coredll.dll functionality (examples >> HERE <<) to get what you want, as this stuff doesn't come wrapped up in the standard WinMobile SDK.
EDIT 2: Here's a Great example that someone wrote to read and control as much of the Power State as possible: techlicity blog I liked it so much I've copied the code to a class in my Mobile Project!