How to set Screensaver programmatically?

G

Guest

Hi,

i wanted to know, how to set a Screensaver programmatically under WinXP and
Win2000?

Thank you
Yavuz Bogazci
 
A

Alex Clark

Hi Yavuz,

It depends what you mean by "set Screensaver". If you want to set it
running, I believe a P/Invoke call to SystemParametersInfo with a param of
SPI_SETSCREENSAVEACTIVE trick.

If you want to actually tell Windows what the current screensaver is (so
that when the user checks out display properties it's selected as their SS
of choice) I'm not sure that there's an API call that will help you, however
you could just programmatically alter the appropriate registry key.

Regards,
Alex Clark
 
G

Guest

ok thank you,

i need the 2nd case. are the registry keys for winxp and win2000 the same?

thanks
yavuz bogazci
 
A

Alex Clark

Hi,
i need the 2nd case. are the registry keys for winxp and win2000 the same?

I can't be sure about that, but my assumption would be that they are (and
quite possibly as far back as Win95 in fact). The best thing to do is see
if you can get your hands on machines running a variety of Win OS's, or if
you have the licenses just install them in VirtualPC and test from there.

Cheers,
Alex Clark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top