c# - .NET Find Windows Sleep Settings -


i find out current windows sleep mode setting i.e. switched on , timer period. ideas?

my preferences (in order) are:

  1. .net managed code
  2. api
  3. read registry value

here stored in registry:

[hkey_current_user\control panel\powercfg] "currentpowerpolicy"="2"      power scheme (default="0")   "0" = home/office desk  "1" = portable/laptop  "2" = presentation  "3" = on  "4" = minimal power management  "5" = max battery   

then access it:

registrykey key= registry.currentuser.opensubkey("control panel\powercfg", true); var value = key.getvalue("currentpowerpolicy", 0); 

there key called policies reg_binary stores specific information. can use example on page read it: http://www.eggheadcafe.com/community/aspnet/2/13312/registry-access-for-regbinary-values.aspx


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -