views:

27

answers:

1

I need to set the sleep/standby timeout programmatically for my device. (ie when it sits idle for a while it turns off.)

It defaults to 120 and I have a tool that let me change it, but I want to change it via my program (dynamically).

Any ideas on how to do that?

+3  A: 

Read Power Manager Suspend Timeouts on MSDN. Make sure to set the global event they mentioned at the end of the article to make the settings take effect.

Shaihi
Thank you. That is exactly what I needed. Care to take a swing at how that event would look? (even code that is close would be nice). If not I will dig till I figure it out. Either way, Thank you!
Vaccano
What do you mean how the event would look? How to open it and set it?
Shaihi
Yeah. I was referring to how to do what you mentioned as the last line of your answer: "Make sure to set the global event they mentioned at the end of the article to make the settings take effect." But I figured it out. I will post the code as an update to my answer when I have tested it. Thanks again for pointing me in the right direction!
Vaccano