Windows - 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: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.
来自 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 critically low", MessageBoxIcon.Stop);
Default:
// Battery is okay.
}
}
通过在该命名空间中四处探索,您可以找到更多信息.
You can find lots more by poking around in that namespace.
这篇关于Windows - CPU 电源管理 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!