0

Suppose I wanted to use something like donut.c as a screensaver on windows. Where could I begin?

Assuming there's no way to get an application into windows10's Settings>screensaver options?
I've considered creating a service that starts an application in fullscreen after a certain amount of idle time. What's a good (minimally invasive and computationally light) way to check for inactivity? Would this be a terrible approach for reasons I'm too naive to realize? Any better approaches?

Cheers, folks!

kendfss
  • 435
  • 5
  • 11
  • 2
    Does this answer your question? [How can I write a screen saver for Windows in C++?](https://stackoverflow.com/questions/5165133/how-can-i-write-a-screen-saver-for-windows-in-c) – Raymond Chen Jul 08 '21 at 04:20

1 Answers1

1

Simplest approach is to take your donut.exe and rename it to donut.scr. Next you click on donut.scr with second mouse button, and select Install. Done.

Now Donut is set as your windows screen saver. Windows will turn it on after sometime of inactivity.

Screensaver is just an exe file. But it should handle few extra command line arguments to work correctly. However if you ignore that, windows will still start it like it would start screensaver. Windows will probably not shut it down once you move your mouse. So you will need to click "x" on it every time you come back to your computer. It's up to screensaver to turn it self off once mouse is moved or key on keyboard is pressed. And that console window will start every time you will go to screensaver settings, instead of being shown in preview. But it will work, and give you starting point.

If you want to go step further you can check main arguments for special commands.

\s = normal screensaver start after timeout.

\c = show settings window. If you have.

= same as \c

\p 123 = preview window inside settings. For start you can just exit and don't display preview.

If you want go even further you can create fullscreen window using winapi. Render things using DirectX or OpenGL. And exit once mouse is moved or key pressed.

LovelyHanibal
  • 317
  • 2
  • 13