Sign in to follow this  
Followers 0
ChrisN

Change Windows 7 Aero Color

5 posts in this topic

How can I change aero glass color from my program? All I have found is this:

[DllImport("dwmapi.dll", EntryPoint = "#127", PreserveSig = false)]
public static extern void DwmGetColorizationParameters(out WDM_COLORIZATION_PARAMS parameters);
[DllImport("dwmapi.dll", EntryPoint = "#131", PreserveSig = false)]
public static extern void DwmSetColorizationParameters(WDM_COLORIZATION_PARAMS parameters, uint uUnknown);
public struct WDM_COLORIZATION_PARAMS {
    public uint Color1;
    public uint Color2;
    public uint Intensity;
    public uint Unknown1;
    public uint Unknown2;
    public uint Unknown3;
    public uint Opaque;
}

source:

http://stackoverflow.com/questions/1487919/how-does-windows-change-aero-glass-color

And I don't have a clue about using external dll's. Can anyone help?

Share this post


Link to post
Share on other sites



Link

Global Const $tagCOLORIZATIONPARAMS = 'dword Color;dword AftGlow;uint Intensity;uint AftGlowBal;uint BlurBal;uint GlassReflInt uint Opaque'

$tCP = DllStructCreate($tagCOLORIZATIONPARAMS)
$Ret = DllCall('dwmapi.dll', 'uint', 'DwmGetColorizationParameters', 'ptr', DllStructGetPtr($tCP))
;If (@error) Or ($Ret[0]) Then
;    Error
;EndIf
DllStructSetData($tCP, 'Color', ...) ; Set a new color
$Ret = DllCall('dwmapi.dll', 'uint', 'DwmSetColorizationParameters', 'ptr', DllStructGetPtr($tCP), 'uint', 0)
;If (@error) Or ($Ret[0]) Then
;    Error
;EndIf

Share this post


Link to post
Share on other sites

Sorry, it doesn't work. I get error 3 for both DllCall()'s

Share this post


Link to post
Share on other sites

You need to call these functions by ordinal

Global Const $tagCOLORIZATIONPARAMS = 'dword Color;dword AftGlow;uint Intensity;uint AftGlowBal;uint BlurBal;uint GlassReflInt; uint Opaque'

$tCP = DllStructCreate($tagCOLORIZATIONPARAMS)
$Ret = DllCall('dwmapi.dll', 'uint', 127, 'ptr', DllStructGetPtr($tCP))

DllStructSetData($tCP, 'Color', 0x00FF00) ; Set a new color
DllStructSetData($tCP, 'Intensity', -1) ; Set a new Intensity
DllStructSetData($tCP, 'Opaque', 0) ; Set a new Opaque
$Ret = DllCall('dwmapi.dll', 'uint', 131, 'ptr', DllStructGetPtr($tCP), 'uint', 0)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Awesome! Thanks @JFX It works!

Edited by ChrisN

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0