[DllImport("dwmapi.dll", EntryPoint = "#131", PreserveSig = false)]
private static extern void DwmSetColorizationParameters(ref DWM_COLORIZATION_PARAMS parameters,bool unknown);
Do you know one? Please contribute it!
just copy the sample and start the method and run it ![]()
Please note that this is an undocumented API and as such is not supported by Microsoft and can be changed or removed in the future without futher notice.
A more reliable approach to set the colorization parameters would be to implement your own method that tries to set each parameter directly in the Windows registry and sends the WM_DWMCOLORIZATIONCOLORCHANGED message to notify all top-level windows about the change, with proper exception handling in the case a value cannot be set. The colorization parameters can be found under the key "HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM". Please note that these are also undocumented and as such can also be changed or removed in the future.
C# Sample
[DllImport("dwmapi.dll", EntryPoint = "#131", PreserveSig = false)]
private static extern void DwmSetColorizationParameters(ref DWM_COLORIZATION_PARAMS parameters,bool unknown);
private struct DWM_COLORIZATION_PARAMS
{
public uint clrColor;
public uint clrAfterGlow;
public uint nIntensity;
public uint clrAfterGlowBalance;
public uint clrBlurBalance;
public uint clrGlassReflectionIntensity;
public bool fOpaque;
}
public void SetParameters(object sender, EventArgs e)
{
DWM_COLORIZATION_PARAMS temp = new DWM_COLORIZATION_PARAMS();
temp.clrColor = 1802811644;
temp.clrAfterGlow = 1802811644;
temp.nIntensity = 8;
temp.clrAfterGlowBalance = 43;
temp.clrBlurBalance = 49;
temp.clrGlassReflectionIntensity = 50;
temp.fOpaque = false;
DwmSetColorizationParameters(ref temp, false);
}
