Printable View
A screen saver is nothing but a ".exe" file renamed as a ".scr" file. To start the SS just run the ".scr" file with /s as the command line parameter. without any command line parameter, the SS configure dialog comes up.
even the OS calls the SS using these command line parameters.
Hello,
I don't know where you can found the current screen saver ( It's may in win.ini, system.ini, or Regedit ) but i know that screen saver are .exe that are rename in .scr so you can execute it with shellexecute or a fonction like that.
Arnaud,
At : [email protected]
Thank you for the replies...Sorry I wasn't more specific, but I'm looking for a Win API or system call that can execute the user's current screen saver so that I don't have to try to figure out which screen saver the user has enabled.
To invoke the currently selected screen saver, call CWnd::OnSysCommand() with the first parameter as SC_SCREENSAVE.
sally
Try the following in the InitInstance of a Win32 application.
CDialog dlg;
dlg.Create(IDD_LAUNCHSS_DIALOG);
dlg.SendMessage(WM_SYSCOMMAND, SC_SCREENSAVE);
dlg.DestroyWindow();
As long as a dialog resource exists within the application that is identified
by IDD_LAUNCHSS_DIALOG, the user's presently defined screen saver is fired off.
Thank you ANONYMOUS!!
IT WORKS!!!
I couldn't (& didn't) use it in the InitInstance routine, but I used it in the button's function and it works wonderfully.
I'm just a beginner, as you can probably tell...
Thanks again!
And thank you to all who answered!!
Marc