Getting Accent brush color of a Window 8 machine through Visual C# code

Hope we all might know the from Widows 8, Microsoft provides a feature name Accent Brush that enables us to have our own colors set to Window App (Windows Phone) as well that may provide more elegant UI theme to user expectations. And some of us think that it will be more complex to retrieve the accent color through Visual C# code. But here it come so simple, that we can get the Accent brush color of the through “ uxthem.dll” and the following code snippet may help it with a small demonstration.
  1. [DllImport("uxtheme.dll", EntryPoint = "#95")]  
  2. public static extern uint GetImmersiveColorFromColorSetEx(uint dwImmersiveColorSet, uint dwImmersiveColorType, bool bIgnoreHighContrast, uint dwHighContrastCacheMode);  
  3. [DllImport("uxtheme.dll", EntryPoint = "#96")]  
  4. public static extern uint GetImmersiveColorTypeFromName(IntPtr pName);  
  5. [DllImport("uxtheme.dll", EntryPoint = "#98")]  
Ebook Download
View all
Learn
View all