vb.net - Changing the solid desktop background color in VB -


i'm trying change solid desktop background color, , i'm using registrykey :

dim cd new colordialog if cd.showdialog = dialogresult.ok     dim rk registrykey = registry.currentuser.opensubkey("control panel\colors", true)     rk.setvalue("background", cd.color.r & " " & cd.color.g & " " & cd.color.b) end if 

i'v seen this question, didn't in case.

the code above working because value in registry editor changing, background color not, if edited color control panel, change same value in registry editor , background color change, have explaining that, or there other way it?

i got work, can't done editing registry key, in fact need use user32.dll api so, , can use registry key value of color only, not set it, steve (↑).

here worked me :

first > declare function use api :

 private declare function setsyscolors lib "user32.dll" (byval 1 integer, byref element integer, byref color integer) boolean 

second > use call function , change color :

dim cd new colordialog if cd.showdialog = dialogresult.ok     dim backgroundcolor integer = colortranslator.towin32(cd.color)     setsyscolors(1, 1, backgroundcolor) end if 

hope useful :)


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -