需要禁用Windows C#中的屏幕保护程序/屏幕锁定/。NET [英] Need to disable the screen saver / screen locking in Windows C#/.Net

查看:613
本文介绍了需要禁用Windows C#中的屏幕保护程序/屏幕锁定/。NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关特定的应用程序,我需要的屏幕保护程序,而它的运行被禁用。操作员可以手动将其关闭,然后再重新打开,但最容易做的事情是只保持屏幕保护程序在海湾应用程序运行时。

For a particular application, I need the screen saver to be disabled while it's running. The operator COULD manually turn it off, and then back on later, but the easiest thing to do would be to just keep the screen saver at bay while the application is running.

我如何做到这一点?我发现code代表实际上SPI_SETSCREENSAVEACTIVE关闭屏幕保护程序,但我不认为这是我想要的。

How do I do this? I've found code for actually turning off the screen saver with SPI_SETSCREENSAVEACTIVE, but I don't think that's what I want.

推荐答案

theoldnewthing 有你的答案:使用的 SetThreadExecutionState(ES_DISPLAY_REQUIRED)

theoldnewthing has your answer: Use SetThreadExecutionState(ES_DISPLAY_REQUIRED).

这是使用视频播放器和PowerPoint。

This is used by video players and PowerPoint.

这篇关于需要禁用Windows C#中的屏幕保护程序/屏幕锁定/。NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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