如何以编程方式确认当前系统电源状态? [英] How to confirm the current system power state programmatically?

查看:65
本文介绍了如何以编程方式确认当前系统电源状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


API
可用于系统进入连接待机模式。但是如何确认系统是否确实已进入

power state
模式?

There are APIs can be used for the system goes into the connect standby mode. But how to confirm whether the system is indeed entered into the power state mode programmatically?


PowerState.ConnectedStandby

Modern Standby
S0低功耗
空闲

Does the PowerState.ConnectedStandby is the same as the Modern Standby (S0 low-power idle)?

DB410C,17763.253,bsp v2121:

DB410C, 17763.253, bsp v2121:

bool b = ShutdownManager.IsPowerStateSupported(PowerState.ConnectedStandby);// b is true.
b = ShutdownManager.IsPowerStateSupported(PowerState.SleepS3);// b is false.
ShutdownManager.EnterPowerState(PowerState.ConnectedStandby);//the monitor was closed but the background app still running.

推荐答案

Hello  moyanming2013,

Hello moyanming2013,

我找不到这样的API来检索当前的系统电源状态。

I can't find such API to retrieve the current system power state.

可能的解决方法:


  1. 要检测设备是否进入给定的电源状态,您可以使用try-catch查看是否有任何异常抛出系统。

  2. 检查< href ="https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/现代待机睡眠研究报告">现代待机睡眠研究报告,看它是否能提供任何有用的信息。
  1. To detect whether the device is enter the given power state, you can use try-catch to see if there is any exception throw by the system.
  2. Check Modern standby SleepStudy report to see if it can provide any useful information.

致以最诚挚的问候,

Rita


这篇关于如何以编程方式确认当前系统电源状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆