tags:

views:

970

answers:

3

I'm using Windows 7 RTM and I wonder how the control panel is able to update the Aero Glass color so smoothly without restarting the DWM (uxsms). DwmSetColorizationColor isn't working any more...

A: 

Here are some MSDN samples for working with Aero:

http://msdn.microsoft.com/en-us/magazine/cc163435.aspx

It's interesting that, though you can retieve settings with DwmGetColorizationColor, it makes no mention at all of the "Set" version of that call. I've not worked with Glass before, so I don't have any additional input, but there has to be a matching function somewhere in 7.

ALSO: It looks like this guy isn't able to get a response either, and Googling for DwmSetColorizationColor returns next to nothing, so there has to be another call for it somewhere. I wish I could offer more help...

rwmnau
+1  A: 

The following methods should be of interest to you:

[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;
}

Make sure you make a call to DwmIsCompositionEnabled before calling the DwmSetColorizationParameters method or it will fail.

As you can see some of the arguments/properties are unknown.
For more information, here is a link (in German)

Zyphrax
+1 to counteract a stupd -1. This answer is an answer to the question "How does it do..." This is probably exactly how it does it. Although i read the original question as "How *does* it do..." and not "*How* does it do..."
Ian Boyd
In Windows 7 the original method DWMSetColorization throws an exception (it was supported in Windows Vista though). I assume it was his intention to find a new method that offers the same functionality as the old one. One option is to write a .theme file and execute that or use the undocumented method I specified above.
Zyphrax
A: 

I wonder if somebody could actually decompile the dll and extract the code that the method uses. That way we would at least have a direction to work from. :(

Darren