[DllImport("uxtheme", EntryPoint = "#122")]
static extern int SetUserColorPreference(ref IMMERSIVE_COLOR_PREFERENCE pcpPreference, bool fForceSetting);
Declare Function SetUserColorPreference Lib "uxtheme.dll" (TODO) As TODO
[StructLayout(LayoutKind.Sequential)]
private struct IMMERSIVE_COLOR_PREFERENCE
{
public uint dwColorSetIndex;
public uint crStartColor;
public uint crAccentColor;
}
None for now
Please add some!
[DllImport("uxtheme", EntryPoint = "#122")]
static extern int SetUserColorPreference(ref IMMERSIVE_COLOR_PREFERENCE pcpPreference, bool fForceSetting);
private static uint ToUint(Color c)
{
return (uint)((c.B << 16) | (c.G << 8) | c.R);
}
[StructLayout(LayoutKind.Sequential)]
private struct IMMERSIVE_COLOR_PREFERENCE
{
public uint dwColorSetIndex;
public uint crStartColor;
public uint crAccentColor;
}
private void SetAccentColor(Color c)
{
IMMERSIVE_COLOR_PREFERENCE temp = new IMMERSIVE_COLOR_PREFERENCE
{
crAccentColor = ToUint(c),
dwColorSetIndex = 0,
crStartColor = ToUint(c)
};
SetUserColorPreference(ref temp, true);
}