c++ 设置控制面板中的电源计划(节能,平衡,高性能)
三个GUID 分别是:
GUID_TYPICAL_POWER_SAVINGS //Automatic(balanced)
GUID_MIN_POWER_SAVINGS //High Performance
GUID_MAX_POWER_SAVINGS //Power Saver
Code:
PowerGetActiveScheme //获取当前活动的电源计划
//设置 电源计划
PowerSetActiveScheme(NULL, &GUID_MIN_POWER_SAVINGS);
PowerSetActiveScheme(NULL, &GUID_MAX_POWER_SAVINGS);
PowerSetActiveScheme(NULL, &GUID_TYPICAL_POWER_SAVINGS);
MSDN LInk:
https://learn.microsoft.com/zh-cn/windows/win32/power/power-setting-guids