Dear members,

I am looking for .NET functions to change power settings of a PC. For example, the hard disk turn off time, screen brightness, monitor turn off time. All these are intended to save energy. After some studies, I found that DeviceIOControl provides such capabilties. However, I am not sure it thats the right direction. Also I have read about Windows Management Instrumentation (WMI). I have no prior experience programming system services. Any expert here that have experience coding such application? All advices are welcomed. Thank you!


Regards,
Nick

Thanks adatapost!! I am now studying the WMI code creator and am looking forward to building my application.

Any other resource or advice are welcomed.

Hi, I've check out the WMI code creator and it is a great program. It allows me to get a lot of information on devices. However, I could not find any that can let me tweak on the settings of hard disk turn off time, display turn off time, etc...

I am looking into building an app (computer power management) that is able to change the hard disk turn off time, display turn off time, pc suspend time. Sorry about the misleading thread title...

WMI may not be able to achieve what I need, or maybe its the lacking of knowledge on my part. Meanwhile, I'll continue researching.

Some update on my progress. I found out that powercfg.exe is a good tool to query and set power schemes. This is only convenient if it is called from the command prompt. I managed to create a process to call the powercfg.exe with some arguments to achieve what I want. However, parsing the results are tedious and I feel that it is not an elegant way. Hence, I am now looking into the powrprof library. My major obstacle now is, I fail to locate powrprof.h file. Anyone here have any experience working with this library? Any advice are welcomed. Thank you!


Regards,
Nick

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.