如何查看系统是否处于待机模式? [英] How can I check to see if system is in standby mode?

查看:225
本文介绍了如何查看系统是否处于待机模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查系统是否处于待机模式,对此是否有Win32 API?我不确定是否与睡眠模式相同.

I'd like to check if the system is in standby mode, is there any Win32 API for that? I'm not sure if it's the same as the sleep mode.

我的应用程序中执行了一些代码,这导致它在退出待机状态时挂起(在待机模式下执行),因此我想避免在计算机处于睡眠/待机状态时运行该代码

There's some code that gets executed in my app, which causes it to hang when coming out of standby (it's executed during the standby mode), so I'd like to avoid running that code when the computer is sleeping/standing by.

提前谢谢!

丹尼斯

也许是不可能的,因为该程序不应该按照下面的答案中所指出的那样运行,因此我将其视为答案:)

edit: perhaps it's impossible, because the program shouldn't be running as was pointed out in the answer below, so I'll count that as an answer :)

推荐答案

当系统处于待机模式时,则不会运行任何程序,因此可以进行以下操作:

When the system is in standby mode, then no program will be running, so the following would be ok:

int is_in_standby() {
  return 0;
}

或者我想念什么吗?

这篇关于如何查看系统是否处于待机模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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