[DllImport("uxtheme.dll", EntryPoint = "#95")]public static extern uint GetImmersiveColorFromColorSetEx(uint dwImmersiveColorSet, uint dwImmersiveColorType, bool bIgnoreHighContrast, uint dwHighContrastCacheMode);[DllImport("uxtheme.dll", EntryPoint = "#96")]public static extern uint GetImmersiveColorTypeFromName(IntPtr pName);[DllImport("uxtheme.dll", EntryPoint = "#98")]public static extern int GetImmersiveUserColorSetPreference(bool bForceCheckRegistry, bool bSkipCheckOnFail);// Get theme colorpublic Color GetThemeColor(){ var colorSetEx = GetImmersiveColorFromColorSetEx( (uint)GetImmersiveUserColorSetPreference(false, false), GetImmersiveColorTypeFromName(Marshal.StringToHGlobalUni("ImmersiveStartSelectionBackground")), false, 0); var colour = Color.FromArgb((byte)((0xFF000000 & colorSetEx) >> 24), (byte)(0x000000FF & colorSetEx), (byte)((0x0000FF00 & colorSetEx) >> 8), (byte)((0x00FF0000 & colorSetEx) >> 16)); return colour;}