Link to home
Start Free TrialLog in
Avatar of FIIS-VSO
FIIS-VSO

asked on

Registry reflects changes, but the Screensaver properties box doesn't

I'm working on a project that will reset the current user's screensaver timeout time to one I specify.
I run the program and the registry reflects the settings I have set, but when I open the screensavers properties box there is no difference. I know I have the right registry key because I will manually change the value in the properties box and the registry immediately reflects the updates.

I've searched around a bit and all I found was that the changes will only take effect if the system is reboot which I know is wrong; there is an immediate update when you click the "Apply" button on the properties box. That is the effect I'm looking for. I have a program that will do this but I don't have the source for it, plus my company needs some additional functionality which I'm trying to add.

I know you can also use the SystemParametersInfo API, but I cannot get it to work right, so any examples of that working would be great.

Well, that about explains it! Any help would be fantastic! Thanks!

HERE'S THE RELATIVE CODE (THIS WILL CHANGE THE CURRENT USER'S SCREENSAVER TIMEOUT, BUT I NEED IT TO TAKE EFFECT IMMEDIATELY)

            Dim regStr As String = "Control Panel\Desktop\"
            Dim secKey As RegistryKey = Registry.CurrentUser.OpenSubKey(regStr, True)

            secKey.SetValue("ScreenSaveTimeOut", "120")

            secKey.Close()

************************************************************************************
EDIT: I upped the points to 500! This is really important to me! Thanks!
************************************************************************************
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FIIS-VSO
FIIS-VSO

ASKER

Any examples of using the API call to change the screen saver timeout and broadcast the update message?
Did you get this solved, or do you still need help?

Bob
Actually you answered my question in another topic I posted, but since I can't find out how to simply delete this post, I'll accept that answer above and give you some more points! Enjoy!

BTW: Here's a link to the other post with the answer I originally accepted:
<a href="https://www.experts-exchange.com/questions/21837908/How-to-Use-SystemParametersInfo-API.html">https://www.experts-exchange.com/questions/21837908/How-to-Use-SystemParametersInfo-API.html</a>