How to change windows screen saver in code...

I need to know how to change the windows screen saver in code or even in the registry...but perferably in code...thanks....I don't figure it's too hard, but I need to know quickly and this place is usually faster than searching:)  Thanks again.
Who is Participating?
SpaxConnect With a Mentor Commented:
It's much easier than I originally thought. Just simply editing the C:\WINDOWS\SYSTEM.INI file and changing the filename after SCRNSAVE.EXE= will effect the change your looking for. If your trying to change the screen saver from one that is already up an running on the users computer, you may be able to perform a sendkeys to fool the saver into terminating. I suppose if the sendkeys fails, you could just halt the screen saver task - but I don't know how far you would want to go to effect this change.

Again, MCAFFE virus checker keeps track of what screensaver was last set by the user and it may try and give the user a warning. For that you would need to look up and change the registry items. Hope that helps you out.

As for changing it on the fly, probably an api or some such. Careful though, some virus checkers don't like unauthorized changing of screensavers.
sharmonAuthor Commented:
That really isn't the clue I was looking for, I already knew that one, but anyhow, if I cannot find a better answer than that, I'll give you the points tomorrow........thanks..
All Courses

From novice to tech pro — start learning today.