窗口 - CPU电源管理API [英] Windows - CPU power management APIs
问题描述
是由Windows的CPU电源管理提供什么样的API(我感兴趣的CPU频率调节,设定最小和最大CPU频率 - 类似于你可以在控制面板中做的电源计划是什么,但以编程的方式)。我也有兴趣在.net中的API。 (这不是我打算在生产环境中使用,而是作为概念的一些动态电源管理算法的证明)
What APIs are provided by Windows for CPU power management (I'm interested in CPU frequency scaling, setting min and max CPU frequency - similar to what you can do in Control Panel in power plans, but in a programmatic way). I'm also interested in .Net APIs. (It is not something I intend to use in a production environment, but rather as a proof of concept for some dynamic power management algorithms)
推荐答案
C ++的电源管理API:<一href="http://msdn.microsoft.com/en-us/library/aa373170.aspx">http://msdn.microsoft.com/en-us/library/aa373170.aspx
The C++ Power Management APIs: http://msdn.microsoft.com/en-us/library/aa373170.aspx
.NET电源管理API是在的Microsoft.Win32
命名空间。
.NET Power Management APIs are in the Microsoft.Win32
namespace.
从<一个实例href="http://msdn.microsoft.com/en-us/library/hxkc1kwd.aspx">http://msdn.microsoft.com/en-us/library/hxkc1kwd.aspx:
private void powerModeChanged(System.Object sender, Microsoft.Win32.PowerModeChangedEventArgs e)
{
int si = SystemInformation.PowerStatus;
switch (si)
{
case BatteryChargeStatus.Low:
MessageBox.Show("Battery is running low", MessageBoxIcon.Exclamation);
case BatteryChargeStatus.Low:
MessageBox.Show("Battery is critcally low", MessageBoxIcon.Stop);
Default:
// Battery is okay.
}
}
您可以找到很多更受该命名空间中闲逛。
You can find lots more by poking around in that namespace.
这篇关于窗口 - CPU电源管理API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!