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