Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
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.
Posted

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.

Posted

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...