Einzelnen Beitrag anzeigen

Gehstock

Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
 
Delphi 2007 Professional
 
#1

Registry einträge in Listview

  Alt 21. Feb 2007, 17:14
Delphi-Quellcode:
function GetCompleteCPU:String;
var
  reg: TRegistry;
  keys: TStringList;
  i: Integer;
  typename, displayname, server: string;
  l: TListItem;
begin
  reg := TRegistry.Create;
  try
    reg.rootkey := HKEY_LOCAL_MACHINE;
    if reg.OpenKey('', False) then
    begin
      keys := TStringList.Create;
      try
        reg.GetKeyNames(keys);
        reg.CloseKey;
        for i := 0 to keys.Count - 1 do
        begin
          if keys[i][1] = '.then
          begin
            if reg.OpenKey(keys[i], False) then
            begin
              typename := reg.ReadString('');
              reg.CloseKey;
              if typename <> 'then
              begin
                if reg.OpenKey(typename, False) then
                begin
                  displayname := reg.ReadString('');
                  reg.CloseKey;
                end;
                if reg.OpenKey(typename + '\Hardware\Description\System\CentralProcessor\0', False) then
                begin
                  server := reg.ReadString('');
                  l := listview3.Items.Add; //+++++++Wird nicht gefunden
                  l.Caption := (Format('"%s"',[keys[i]]));
                  l.SubItems.Add(Format('"%s"',[ProcessorNameString]));
                  l.SubItems.Add(Format('"%s"',[Update Status]));
                  l.SubItems.Add(Format('%s',[VendorIdentifier]));

                  reg.CloseKey;
                end;
              end;
            end;
          end;
        end;
      finally
        keys.Free;
      end;
    end;
  finally
    reg.Free
  end;
end;
bei obengenannten Code wird der Listview nicht gefunden obwohl vorhanden
Marcel
  Mit Zitat antworten Zitat