How do I change the screensaver programmatically?
问题 I'd like to change the current Screensaver for a custom one (which I previously loaded as a resource in Visual Studio) using C#. How could that be done? I've looked for it on Google and SO, but it all talks about "How to create a Screensaver", not "How to change a Screensaver". If possible, it should work on WinXP, Vista and 7. 回答1: I'll answer my question with the piece of code that worked to me: public sealed class Screensaver { Screensaver() { } const int SPI_SETSCREENSAVEACTIVE = 0x0011;