Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than uxtheme, prefix the name with the module name and a period.
private static Color ToColor(uint c)
{
int R = (int)(c & 0xFF) % 256;
int G = (int)((c >> 8) & 0xFFFF) % 256;
int B = (int)(c >> 16) % 256;
return Color.FromArgb(R, G, B);
}
When getting the accent color value, USE the crStartColor property, as crAccentColor might return 0, instead of the accent color.
Sample Code:
public Color GetAccentColor()
{
IMMERSIVE_COLOR_PREFERENCE accent = new();
GetUserColorPreference(ref accent, false);
return ToColor(accent.crStartColor);
}
GetUserColorPreference will get the current theme Accent color and the Start menu color through the IMMERSIVE_COLOR_PREFERENCE structure. Its counterpart is SetUserColorPreference
9/15/2022 3:56:45 PM - -151.56.233.32
SetUserColorPreference will set the current theme Accent color and the Start menu color through uint numbers representing colors inside the IMMERSIVE_COLOR_PREFERENCE structure
9/15/2022 3:45:03 PM - -37.101.209.105
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).