I want to write a screen saver for Windows using the Windows API. How can I start to write it?
Go to Settings > Personalization > Lock screen, and select Screen saver settings. In the Screen Saver Settings window, choose a screen saver from the drop-down list.
ScreenSaver - Show the Settings dialog box. ScreenSaver /c - Show the Settings dialog box, modal to the foreground window. ScreenSaver /p <HWND> - Preview Screen Saver as child of window <HWND>. ScreenSaver /s - Run the Screen Saver.
SCR). Since you want to create your own screensaver, select the "Create SCR file (Screensaver, '. scr')." Then, select the folder where you want to save the screensaver and, of course, name the file. Finally, press the Create button and allow IrfanView to build your new screensaver.
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):
Next check out some DirectX / OpenGL / SDL tutorials and write some eye candy.
Obviously you should check for mouse movements and key presses and exit your application if the user wakes up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With