2

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?

Vaccano
  • 78,325
  • 149
  • 468
  • 850

1 Answers1

2

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
  • 3,952
  • 4
  • 27
  • 47
  • 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 Jul 14 '10 at 16:45
  • What do you mean how the event would look? How to open it and set it? – Shaihi Jul 14 '10 at 20:15
  • 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 Jul 14 '10 at 20:31