update desktop after registry edit

bjay55

Active member
Joined
Mar 19, 2005
Messages
25
I have changed the desktop color value at - HKEY_CURRENT_USER\Control Panel\Colors\Background in the registry, but to get change to take effect I have to restart the computer. How would I make the change take effect without restarting the computer. Thanks in advance for any help.
 
Still having trouble

I declared the setsyscolors function

Private Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, ByVal lpSysColor As Long, ByVal lpColorValues As Integer) As Long

then used this code but the desktop color does not change color.

Dim ret As Long
Const COLOR_BACKGROUND = 1
ret = SetSysColors(1, COLOR_BACKGROUND, RGB(100, 100, 100))

the function returns the number 8975933078237085696. Am I doing something wrong. Would greatly appreciate your help.
 
Got it!

Hey, I got it working. I had declared the function wrong.

this did not work:
Declare Function SetSysColors Lib "user32" (ByVal nChanges As Long, ByRef lpSysColor As Long, ByRef lpColorValues As Long) As Long

this worked:
Declare Function SetSysColors Lib "user32" (ByVal nChanges As Integer, ByRef lpSysColor As Integer, ByRef lpColorValues As Integer) As Integer
 
Sorry, I should have mentioned that the site gives VB6 declarations, not .Net.
 
Back
Top