// Private functions private void InitRegistries() { RegistryKey RKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true); string[] values=RKey.GetValueNames(); foreach(string r in values){ StartupItem st = new StartupItem(); st.name = r; st.path = RKey.GetValue(r).ToString(); st.rights = "CurrentUser"; st.type = StartupType.Registry; Items.Add(st); } RKey.Close(); values = null; RKey = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true); values = RKey.GetValueNames(); foreach (string r in values) { StartupItem st = new StartupItem(); st.name = r; st.path = RKey.GetValue(r).ToString(); st.rights = "LocalMachine"; st.type = StartupType.Registry; Items.Add(st); } RKey.Close(); }
private bool DisableItem(String name, String Path) { StartupProgramChanger stChanger; StartupItem stItem = new StartupItem(); foreach (StartupItem item in StartupItemList) { if (item.name == name && item.path == Path) { stItem = item; } } stChanger = new StartupProgramChanger(stItem); if (stChanger.Disable()) { stItem.Status = false; //Disabling the item... ManiPulateListView(); return true; } return false; }
private bool MatchToList(StartupItem SItem) { foreach (StartupItem Item in StartupItemList) { if (Item.name == SItem.name && Item.path == SItem.path) { return true; } } return false; }
public StartupProgramChanger(StartupItem st) { this.st = st; }