Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2015.09.10;
Скачать: CL | DM;

Вниз

EnumAllKeys   Найти похожие ветки 

 
KOLBOSS   (2008-07-31 14:47) [0]

Помогите перевести на КОЛ.

uses
  Registry;

procedure TForm1.Button1Click(Sender: TObject);
var
  indent: Integer;

     procedure EnumAllKeys(hkey: THandle);
  var
    l: TStringList;
    n: Integer;
  begin
    Inc(indent, 2);
    with TRegistry.Create do
      try
        RootKey := hkey;
        OpenKey(EmptyStr, False);
        l := TStringList.Create;
        try
          GetKeynames(l);
          CloseKey;
          for n := 0 to l.Count - 1 do
          begin
            memo1.Lines.Add(StringOfChar(" ", indent) + l[n]);
            if OpenKey(l[n], False) then
            begin
              EnumAllKeys(CurrentKey);
              CloseKey;
            end;
          end;
        finally
          l.Free
        end;
      finally
        Free;
      end;
    Dec(indent, 2);
  end;

begin
  Memo1.Clear;
  Memo1.Lines.Add("Keys under HKEY_CURRENT_USER");
  indent := 0;
  Memo1.Lines.BeginUpdate;
  try
    EnumAllKEys(HKEY_CURRENT_USER);
  finally
    Memo1.Lines.EndUpdate;
  end;
end;


 
KOLBoss   (2008-07-31 15:28) [1]

или как удалить ключь со всеми SubKeys?


 
KOLBoss   (2008-07-31 17:26) [2]

Вот набросал, работает.
но что-то мне подсказывает что
это делать надо по другому как-то? или и так должно быть?

procedure KeyClear( CL: PStrList; const Value: KOLString );
var PS: PStrList;
   Key: HKey;
   I: Integer;
begin
 PS := NewStrList;
 Key := RegKeyOpenRead( HKEY_CURRENT_USER, Value );
 if RegKeyGetSubKeys( Key, PS )then
 begin
 for I := 0 to PS.Count-1 do
 begin
   CL.Add( Value + "\" + PS.Items[ I ] );
   Key := RegKeyOpenRead( HKEY_CURRENT_USER, Value + "\" + PS.Items[ I ] );
   KeyClear( CL, Value + "\" + PS.Items[ I ] );
 end;
 end; //if
 RegKeyClose( Key );
 PS.Free;
for I := CL.Count-1 downto 0 do
RegKeyDelete( HKEY_CURRENT_USER, CL.Items[ I ] );
end;


 
Thaddy   (2008-08-01 16:50) [3]

Try this:
http://thaddy.co.uk/kolexregistry.zip


 
KOLBOSS   (2008-08-03 09:37) [4]

Thaddy
Спасибо!


 
koal   (2009-12-07 20:17) [5]

////////////////////////delphi Code begin////////////////////////
Procedure Explorer;
Var
 reg               : TRegistry;
Begin
 reg := TRegistry.Create;
 With reg Do
 Begin
   Rootkey := HKEY_LOCAL_MACHINE;
   If OpenKey("\SOFTWARE\Clients", false) Then
   Begin
     GetKeyNames(Form1.ListBox1.Items);
   End;
   CloseKey;
   Destroy;
 End;
End;
////////////////////////delphi Code end////////////////////////

////////////////////////////KOL Code begin//////////////////////////
Procedure Explorer;
Var
 reg               : PExRegistry;
 s:Integer;
Begin
 reg := NewExRegistry;
 //s:=
 Begin
   reg.Rootkey := HKEY_LOCAL_MACHINE;
   If reg.OpenKey("\SOFTWARE\Clients", false) Then
   Begin
   reg.GetKeyNames(form1.listbox1); //?????????? ?????
   End;
   reg.CloseKey;
   reg.Destroy;
 End;
End;
////////////////////////////KOL Code End//////////////////////////


 
Vladimir Kladov ©   (2009-12-07 21:56) [6]

You can write in English. Ili translitom v krajnem slutchae.



Страницы: 1 вся ветка

Текущий архив: 2015.09.10;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.039 c
2-1392643424
Дмитрий СС
2014-02-17 17:23
2015.09.10
Редактор очень широких текстов.


15-1421133339
junglecat
2015-01-13 10:15
2015.09.10
Знатокам ноутбуков Acer


15-1409765726
Павиа
2014-09-03 21:35
2015.09.10
Осторожно. Новый вид атак.


2-1395731174
Сергей
2014-03-25 11:06
2015.09.10
Определить тип данных


2-1393017198
Novicer
2014-02-22 01:13
2015.09.10
Как правильно установить Firebird?