//Enable install mode private void Button5_Click(object sender, EventArgs e) { if (MessageBox.Show("This launches the program in auto mode every time the pc starts up (after userinit.exe is loaded). Continue?", "Auto-launch Simple Clasic Theme", MessageBoxButtons.YesNo) == DialogResult.Yes) { ExtraFunctions.UpdateStartupExecutable(true); } }
// Auto-launch SCT on boot private void ButtonRunOnBoot_Click(object sender, EventArgs e) { if (MessageBox.Show($"This makes SCT automatically launch when you log onto your PC. You can use the boot scripts in {Configuration.InstallPath} to configure things to load before Classic Theme gets enabled. Continue?", "Run Simple Clasic Theme on boot", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ExtraFunctions.UpdateStartupExecutable(true); } }
//Main code: loads the UI private void Form1_Load(object sender, EventArgs e) { numericUpDown1.Maximum = Int32.MaxValue; ExtraFunctions.UpdateStartupExecutable(false); Registry.CurrentUser.OpenSubKey("SOFTWARE", true).CreateSubKey("1337ftw").CreateSubKey("SimpleClassicTheme"); checkBox1.Checked = bool.Parse(Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\1337ftw\SimpleClassicTheme", "EnableTaskbar", false.ToString()).ToString()); File.WriteAllText(Path.Combine(Path.GetTempPath(), "\\addSchemes.bat"), Properties.Resources.addSchemes); Process.Start(new ProcessStartInfo() { FileName = Path.Combine(Path.GetTempPath(), "\\addSchemes.bat"), Verb = "runas", UseShellExecute = false, CreateNoWindow = true }); Shown += Form1_Shown; var lol = Registry.CurrentUser.OpenSubKey("SOFTWARE", true).CreateSubKey("1337ftw").CreateSubKey("SimpleClassicTheme").GetValue("TaskbarDelay", 5000); numericUpDown1.Value = (int)lol; CheckDependenciesAndSetControls(); }
private void MainForm_Load(object sender, EventArgs e) { SystemMenu menu = new SystemMenu(); SystemMenu.CopyToolStripToMenu(menuStrip1, menu); Controls.Remove(menuStrip1); SystemMenu = menu; panel1.ClientSize = new Size(panel1.ClientSize.Width, label2.Location.Y + 27); ClientSize = new Size(panel1.Width, panel1.Height + menu.Height); panel1.Location = new Point(0, 0); ExtraFunctions.UpdateStartupExecutable(false); File.WriteAllText($"{Configuration.InstallPath}addSchemes.bat", Properties.Resources.reg_classicschemes_add); Process.Start(new ProcessStartInfo() { FileName = $"{Configuration.InstallPath}addSchemes.bat", Verb = "runas", UseShellExecute = false, CreateNoWindow = true }); Version sctVersion = Assembly.GetExecutingAssembly().GetName().Version; label2.Text = label2.Text.Replace("%v", sctVersion.ToString(3)).Replace("%r", sctVersion.Revision.ToString()); CheckDependenciesAndSetControls(); if (ExtraFunctions.ShouldDrawLight(SystemColors.Control)) { pictureBox1.Image = Properties.Resources.sct_light_164; } else { pictureBox1.Image = Properties.Resources.sct_dark_164; } if (DateTime.Now.Year == 2022 && DateTime.Now.Day == 1 && DateTime.Now.Month == 1) { //linkLabel1.Hide(); //label2.Text = "Happy New Year!"; } }