Ver Mensaje Individual
  #3  
Antiguo 30-06-2006
paren paren is offline
Miembro
 
Registrado: jul 2004
Ubicación: Tijuana, B. C. Mexico
Posts: 18
Reputación: 0
paren Va por buen camino
Código Delphi [-]
procedure TfrmMain.getValues( rootKey : HKEY; key : string; displayValues : TStrings );
var
  reg : TRegistry;
  regDataType : TRegDataType;
  listValues : TStringList;
  i : integer;
begin
  reg := nil;
  try
    reg := TRegistry.Create( KEY_QUERY_VALUE );
    reg.RootKey := rootKey;
    if( reg.OpenKeyReadOnly( key ) ) then
    begin
      try
        listValues :=  TStringList.Create;
        reg.GetValueNames( listValues );
        {
        for i := 0 to listValues.Count - 1 do
        begin
          regDataType := reg.GetDataType( listValues[ i ] );
          if( regDataType = rdString ) or ( regDataType = rdExpandString ) then
          begin
            if( reg.ReadString( listValues[ i ] ) = 'INTERSOLV InterBase ODBC Driver (*.gdb)' ) then
            begin
              displayValues.Add( listValues[ i ] );
            end;
          end;
        end;
        }
        displayValues.Assign( listValues );
      finally
        reg.CloseKey;
      end;
    end;
  finally
    reg.Free;
  end;
end;

Lo mandas llamar con
Código Delphi [-]
procedure TfrmMain.Button1Click(Sender: TObject);
begin
  getValues( HKEY_LOCAL_MACHINE, 'SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources', ListBox1.Items );
end;
__________________
http://www.linuxtj.org/

Última edición por paren fecha: 30-06-2006 a las 21:32:55.
Responder Con Cita