0
点赞
收藏
分享

微信扫一扫

ListView_Registry


var
  reg: TRegistry;
  KeyList: TStringList;
  intIdx: Integer;
  Itm: TListItem;
  s: string;
begin
  try
    KeyList := TStringList.Create;
    reg := TRegistry.Create;
    reg.RootKey := HKEY_LOCAL_MACHINE;
    reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Run', true);
    reg.GetValueNames(KeyList);

    for intIdx := 0 to KeyList.Count - 1 do
    begin
      Itm := lv1.Items.Add;
      s := reg.ReadString(KeyList[intidx]);
      Itm.Caption := IntToStr(intidx + 1);
      Itm.SubItems.add(keylist[intidx]);
      itm.SubItems.Add('Reg_Sz');
      Itm.ImageIndex := 8;                            //caption图标
      Itm.SubItemImages[0] := 1;                      //subItem图标
      Itm.SubItemImages[1] := 8;
      Itm.SubItemImages[2] := 3;
      Itm.SubItems.Add(s);
    end;
  finally
    reg.CloseKey;
    KeyList.Free;
  end;
end;

ListView_Registry_microsoft

 

举报

相关推荐

0 条评论