Esempio n. 1
0
 private void restoreDefaultBtn_Click(object sender, EventArgs e)
 {
     try
     {
         WindowCustomizationUtility.DeleteInactiveAccentColor();
     }
     catch (ArgumentException) { }
 }
Esempio n. 2
0
        private void currentInactiveAccentColorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Color systemInactiveAccentColor = WindowCustomizationUtility.GetInactiveAccentColor();

            Red   = systemInactiveAccentColor.R;
            Green = systemInactiveAccentColor.G;
            Blue  = systemInactiveAccentColor.B;
        }
Esempio n. 3
0
 private void submitBtn_Click(object sender, EventArgs e)
 {
     try
     {
         WindowCustomizationUtility.SetInactiveAccentColor((byte)_red, (byte)_green, (byte)_blue);
     }
     catch (UnauthorizedAccessException)
     {
         MessageBox.Show(
             Strings.RegistryInaccessibleErrorMessage,
             Strings.RegistryUpdateErrorTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 4
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     if (!WindowCustomizationUtility.IsTitlebarColorPrevalenceEnabled())
     {
         DialogResult result = MessageBox.Show(
             Strings.ColorDisabledWarningMessage,
             Strings.ColorDisabledWarningTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (result == DialogResult.Yes)
         {
             WindowCustomizationUtility.SetTitlebarColorPrevalence(true);
         }
     }
 }
Esempio n. 5
0
        private void exportAccentColorsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter           = "Windows Registry files (*.reg)|*.reg|All files (*.*)|*.*";
            saveFileDialog.RestoreDirectory = true;

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                Color inactiveAccentColor = WindowCustomizationUtility.GetInactiveAccentColor();
                Color activeAccentColor   = WindowCustomizationUtility.GetActiveAccentColor();
                _windowColor.SaveAccentColorsToRegFile(inactiveAccentColor, activeAccentColor, saveFileDialog.FileName);
            }
        }
Esempio n. 6
0
        private void autoBtn_Click(object sender, EventArgs e)
        {
            var accentColor = WindowCustomizationUtility.GetActiveAccentColor();

            var rgb = new Rgb(accentColor.R, accentColor.G, accentColor.B);
            var hsl = rgb.To <Hsl>();

            hsl.L *= 1.65;
            rgb    = hsl.To <Rgb>();

            Red   = (int)rgb.R;
            Green = (int)rgb.G;
            Blue  = (int)rgb.B;
        }