Exemplo n.º 1
0
        // 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();
        }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 private bool MatchToList(StartupItem SItem)
 {
     foreach (StartupItem Item in StartupItemList)
     {
         if (Item.name == SItem.name && Item.path == SItem.path)
         {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 4
0
 public StartupProgramChanger(StartupItem st)
 {
     this.st = st;
 }