Windows 为 CPU 电源管理提供了哪些 API(我对 CPU 频率缩放、设置最小和最大 CPU 频率感兴趣 - 类似于您可以在电源计划中的控制面板中执行的操作,但以编程方式)。我也对 .Net API 感兴趣。(这不是我打算在生产环境中使用的东西,而是作为一些动态电源管理算法的概念证明)
问问题
4376 次
3 回答
5
C++ 电源管理 API:http: //msdn.microsoft.com/en-us/library/aa373170.aspx
.NET 电源管理 API 位于Microsoft.Win32
命名空间中。
来自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.
于 2010-03-23T20:13:40.243 回答
2
您是否尝试过深入研究电源管理 API?
于 2010-03-15T23:13:06.230 回答
1
Have you checked the WMI way ? The Win32_Processor class provides a lot of informations like LoadPercentage, PowerManagementCapabilities...
http://msdn.microsoft.com/en-us/library/aa394373%28VS.85%29.aspx
WMI Reference : http://msdn.microsoft.com/en-us/library/aa394572%28VS.85%29.aspx
于 2010-03-23T21:24:36.020 回答