Windows - CPU power management APIs

前端 未结 3 1045
花落未央
花落未央 2020-12-10 06:56

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 Contr

相关标签:
3条回答
  • 2020-12-10 07:21

    The C++ Power Management APIs: http://msdn.microsoft.com/en-us/library/aa373170.aspx

    .NET Power Management APIs are in the Microsoft.Win32 namespace.

    Example from 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.

    0 讨论(0)
  • 2020-12-10 07:24

    Have you tried digging in the power-management API ?

    0 讨论(0)
  • 2020-12-10 07:27

    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

    0 讨论(0)
提交回复
热议问题