开发者

How to prevent terminal (Windows-CE) from shut-down after 5 minutes

开发者 https://www.devze.com 2023-03-31 11:02 出处:网络
How to prevent terminal (Windows-CE) 开发者_运维问答from shut-down after 5 minutes the terminal is Motorola MC3190 (Windows-CE) and if i dont touch the screen for 5 minutes

How to prevent terminal (Windows-CE) 开发者_运维问答from shut-down after 5 minutes

the terminal is Motorola MC3190 (Windows-CE) and if i dont touch the screen for 5 minutes

the terminal shut-down. how to prevent this ?

i need the solution in C# code.

thanks in advance


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.


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


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.


Is your Motorola MC3190 configured to Turn Off if it is running on Battery Power? Will it ever turn off if on External Power?

How to prevent terminal (Windows-CE) from shut-down after 5 minutes

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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号