从Windows 8地铁睡觉禁用应用 [英] Disable Application from sleeping in Windows 8 Metro

查看:122
本文介绍了从Windows 8地铁睡觉禁用应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,它显示视频和正在运行到一个问题,即机器去击中睡眠时间限制而播放视频时入睡后的应用程序。有没有一种方法来禁用在Windows 8 Metro应用这种行为?

I am working on an app which displays videos and am running into an issue where the machine goes to sleep after hitting the sleep time limit while a video is playing. Is there a way to disable this behavior in a Windows 8 Metro application?

推荐答案

您应该使用的 DisplayRequest 类,具体的 DisplayRequest.RequestActive 用于这一目的。你还必须记住调用DisplayRequest.RequestRelease一旦你完成,让显示器休眠,例如,如果你不主动播放电影,或在菜单画面等。

You should use the DisplayRequest class, specifically DisplayRequest.RequestActive for this purpose. You must also remember to call DisplayRequest.RequestRelease once you are done to allow the display to sleep, for example, if you are not actively playing the movie, or in a menu screen, etc.

这篇关于从Windows 8地铁睡觉禁用应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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