Stop Screensaver programmatically

走远了吗. 提交于 2019-12-10 10:38:07

问题


How can I stop the screensaver while it's running? without moving the mouse or pressing a key on the keyboard. My applications input is from a card reader, if the screen saver is running my application is still working fine but the screen saver doesn't stop when an input is received on the card reader.

I've tried this http://www.codeproject.com/Articles/17067/Controlling-The-Screen-Saver-With-C , doesn't seem to work for me.

I tried faking a mouse movement like on this thread How do I turn off the windows screen saver if it is running using C#? and as mentioned in the thread, it doesn't seem to work on windows 8(i'm running on windows 8.1).

I even tried SendKeys.

Most other questions/examples I see are for stopping the screen saver from starting which I don't want. I want the screen saver to start and stopped if I get an input in my card reader.

来源:https://stackoverflow.com/questions/38282770/stop-screensaver-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!