Retrieve state of Windows 10 Power mode slider

耗尽温柔 提交于 2020-06-10 03:42:31

问题


Is there any API to retrieve a state of Windows 10 Power mode slider?

I was looking at Windows.System.Power namespace. But PowerManager class seem to provide only an immediate state of the power system, but not user preferences set by the slider.

The slider also exists somehow in parallel with previous "power plan" settings. It does not seem that the slider state is reflected directly in Win32_PowerPlan.


回答1:


Change the position of the slider, and the registry key:HKLM\SYSTEM\ControlSet001\Control\Power\User\PowerSchemes\ActiveOverlayAc/DcPowerScheme will also change. ActiveOverlayAcPowerScheme is for non-battery powered and ActiveOverlayDcPowerScheme is for battery powered. However, Starting with Windows release 1903 the slider is available for AC only devices as an OEM opt-in feature. The values of the key ActiveOverlayAcPowerScheme and the corresponding slider modes are as follows:

Better Battery {961CC777-2547-4F9D-8174-7D86181b8A7A}

Better Performance {381B4222-F694-41F0-9685-FF5BB260DF2E}

Best Performance {DED574B5-45A0-4F42-8737-46345C09C238}

the ActivePowerScheme will be overlaid with ActiveOverlayAcPowerScheme. you can retrieve the key value to get the slider mode.



来源:https://stackoverflow.com/questions/56220823/retrieve-state-of-windows-10-power-mode-slider

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!