Changing Window colour and appearence in VB

xjamesfx

Member
Joined
Apr 3, 2011
Messages
12
Programming Experience
Beginner
Hey, i am looking to change the windows colour and colour intensity. These settings are accessable through

Control Panel\Appearance and Personalization\Personalization\Window Color and Appearance

But is there a way that i can remotely change these two settings through functions in my windows form application?

Also is there any way of removing the slight blur on the window bars/taskbar when using an aero theme?

Cheers
 
pinvoke.net: SetSysColors (user32)
pinvoke.net: COLOR_ (Constants) Color Enum here specifies the elements, I renamed it COLORX to avoid name clash.

VB declaration
VB.NET:
Private Declare Function SetSysColors Lib "user32.dll" (ByVal nChanges As Int32, ByVal lpSysColor() As Int32, ByVal lpColorValues() As UInt32) As Int32
VB code example to change Window color, and persist to registry:
'change window color
Dim colWindow = Color.Yellow
Dim elements = {COLORX.COLOR_WINDOW}
Dim colors = {CUInt(ColorTranslator.ToWin32(colWindow))}
SetSysColors(elements.Length, elements, colors)

'persist for reboot
Using reg = My.Computer.Registry.CurrentUser.OpenSubKey("Control Panel\Colors", True)
    reg.SetValue("Window", String.Format("{0} {1} {2}", colWindow.R, colWindow.G, colWindow.B))
End Using
 
Back
Top