windows-screensaver

How do I change the screensaver programmatically?

南笙酒味 提交于 2019-12-01 15:18:00
问题 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;

How can I write a screen saver for Windows in C++?

天涯浪子 提交于 2019-11-30 14:15:38
问题 I want to write a screen saver for Windows using the Windows API. How can I start to write it? 回答1: Basically a screensaver is just a normal application that accepts a few command line options, provided by windows, to determine if it should start fullscreen or in a preview window. So, write a normal exe-application that takes the following command line arguments (from http://msdn.microsoft.com/en-us/library/ms686421(v=vs.85).aspx): /s – Start the screensaver in full-screen mode. /c – Show the