停止系统进入“待机" [英] Stop system entering 'standby'

查看:38
本文介绍了停止系统进入“待机"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的应用程序运行时阻止主机进入 standby 模式?

How can i stop the host machine entering standby mode while my application is running?

是否有任何 win32 api 调用来执行此操作?

Is there any win32 api call to do this?

推荐答案

有两个 API,具体取决于 Windows 的版本.

There are two APIs, depending on what version of Windows.

XP、2000、2003:

XP,2000, 2003:

http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx

回复 PBT_APMQUERYSUSPEND.

Respond to PBT_APMQUERYSUSPEND.

Vista,2008 年:

Vista, 2008:

http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx

阻止计算机进入睡眠状态的正当理由可能有很多.例如,观看视频、播放音乐、编译长时间运行的构建、下载大文件等.

There could be many valid reasons to prevent the computer from going to sleep. For example, watching a video, playing music, compiling a long running build, downloading large files, etc.

这篇关于停止系统进入“待机"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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