//At Start up Unchecked private void GeneralCheckBoxStartAtStartUpUnChecked(object sender, System.Windows.RoutedEventArgs e) { this.GeneralCheckBoxStartAtStartUp.IsEnabled = false; this.Cursor = Cursors.Wait; RegeditWriteRead registryDaelete = new RegeditWriteRead(); registryDaelete.RegistryKeyDelete(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\", "Albatross"); Properties.Settings.Default.StartupEnable = false; Properties.Settings.Default.Save(); this.GeneralCheckBoxStartAtStartUp.IsEnabled = true; this.Cursor = Cursors.Arrow; }
//At Start Up Checked private void GeneralCheckBoxStartAtStartUpChecked(object sender, System.Windows.RoutedEventArgs e) { this.GeneralCheckBoxStartAtStartUp.IsEnabled = false; this.Cursor = Cursors.Wait; RegeditWriteRead registryWrite = new RegeditWriteRead(); registryWrite.RegistryWriter(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Albatross", string.Format("{0} -s",System.Reflection.Assembly.GetExecutingAssembly().Location), Microsoft.Win32.RegistryValueKind.String); Properties.Settings.Default.StartupEnable = true; Properties.Settings.Default.Save(); this.GeneralCheckBoxStartAtStartUp.IsEnabled = true; this.Cursor = Cursors.Arrow; }