Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is UpdatePerUserSystemParameters?

In my service I need to issue a "refresh" after changing the logon screensaver timeout. While doing research, I kept finding references to UpdatePerUserSystemParameters API. This API seems to be present in user32.dll but I can't find out what exact does it do? (Well, besides literally reading its name.) Any suggestions?

like image 345
c00000fd Avatar asked Jan 13 '14 07:01

c00000fd


1 Answers

It was/is(?) a way for forcing the OS to refresh certain system settings by re-reading the relevant registry keys. In particular for colour schemes or desktop backgrounds. So it meant that you could change e.g. the Windows desktop wallpaper by merging a .reg file into the registry and then executing UpdatePerUserSystemParameters from user32.dll to make it read and apply the changed entries.

As the post you linked dictates, the SystemParametersInfo function is the correct way to change system parameters, and this must be done programatically rather than via a registry hack and a forced refresh from a .bat file.

like image 195
Roger Rowland Avatar answered Oct 22 '22 18:10

Roger Rowland