怎么得到注册表里所有的Unistall项和Run项.然后可以删除,更改!就象Windows优化大师一样!

解决方案 »

  1.   

    对[注册表]的操作最好使用[TRegistry]->[Registry.pas]
      RUN:
      [HKEY/SoftWare/Microsoft/Windows/CurrentVersion/Run]
      Uninstall
      [HKEY/SoftWare/Microsoft/Windows/CurrentVersion/Uninstall]
      

  2.   

    var
      Reg: TRegistry;
      Str1:TStrings;
    begin
      Reg := TRegistry.Create;
      try
        //读
        Reg.RootKey := HKEY_LOCAL_MACHINE;
        if Reg.OpenKey   ('Software\Microsoft\Windows\CurrentVersion\uninstall',false) then
        begin
          if Reg.HasSubKeys then  //判断是否有子键
            Reg.GetKeyNames(Str1);  //得到所有子键的名称
        end;  
      finally
        Reg.CloseKey;              
        Reg.Free;
      end;
    end;
      

  3.   

    对于Str1中的任一项//修改
    TRegistry.RenameValue;
    TRegistry.WriteString;
    修改的函数有很多,可以根据需要查一下Delphi的帮助,里面说的挺清楚的。//删除:
    TRegistry.DeleteKey;
    TRegistry.DeleteValue
    对于Run项,按同样的步骤操作就可以了,只是路径改为:
        Reg.RootKey := HKEY_LOCAL_MACHINE;
        Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run',False);
      

  4.   

    运行出错!Str1没有处使化.Strl:=TStrings.Create也不行,还有错!