Regedit_List

var
  i, d: integer;
  List: TStringlist;
  Reg: Tregistry;
  s: string;
begin
  List := TStringList.Create;
  Reg := Tregistry.Create;
  Reg.RootKey := HKEY_LOCAL_MACHINE;
  Reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/run', false);
  Reg.GetValueNames(List);
  try
    for i := 0 to list.Count - 1 do
    begin
      if Reg.ValueExists(List[i]) then
        for d := 0 to 3 do
        begin
          Reg.ReadString(List[i]);
          AdvStringGrid1.Rowcount := i;
          AdvStringGrid1.FontColors[1, i + 1] := clred;
          AdvStringGrid1.Cells[0, i + 1] := '0' + inttostr(i + 1);
          AdvStringGrid1.Cells[1, i + 1] := list[i];
          AdvStringGrid1.Cells[2, i + 1] := Reg.ReadString(List[i]);
          AdvStringGrid1.AddImageIdx(1, i + 1, 0, haBeforeText, vatop);
          AdvStringGrid1.AddImageIdx(2, i + 1, 2, haBeforeText, vatop);
          AdvStringGrid1.FontColors[2, i + 1] := clFuchsia;
          AdvStringGrid1.Alignments[0, i] := taCenter;
        end
    end;
  finally
    Reg.CloseKey;
    Reg.Free;

    List.Free;
  end
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  i: integer;
begin
  for i := 0 to 2 do
  begin
    AdvStringGrid1.Cells[0, 0] := '序号';
    AdvStringGrid1.Cells[1, 0] := '键名';
    AdvStringGrid1.Cells[2, 0] := '路径';
    AdvStringGrid1.FontStyles[i, 0] := AdvStringGrid1.FontStyles[i, 0] + [fsBold]; //加粗
    AdvStringGrid1.FontColors[i, 0] := clblue; //颜色
    AdvStringGrid1.Alignments[0, 0] := taCenter; //Align对齐方式
  end
end;
  • 阿里云国际版折扣https://www.yundadi.com

  • 阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6