Ver Mensaje Individual
  #1  
Antiguo 15-04-2012
nickolas nickolas is offline
Miembro
NULL
 
Registrado: may 2011
Posts: 32
Reputación: 0
nickolas Va por buen camino
Question Usar registro window

Hola hace casi un año qe uso delphi pero a ahora me surgio ganas de guardar datos en registro de window alguien sabe como se haria eso. y si hay que agregar alguna api de window o algo?. por que hasta ahora tengo este codigo pero me salta error que dice que reconoce el tipo "TRegistry".

Este es el codigo:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var Reg: TRegistry;
begin
  // Creamos un objeto para manejar el registro
  Reg := TRegistry.Create;

  // Guardamos las opciones
  try
    Reg.RootKey := HKEY_LOCAL_MACHINE;
    if Reg.OpenKey( '\Software\MiPrograma', True ) then
    begin
      Reg.WriteString( 'IMPRESORA', IMPRESORA.Text );
      Reg.WriteInteger( 'COPIAS', COPIAS.Value );
      Reg.WriteBool( 'VISTAPREVIA', VISTAPREVIA.Checked );
      Reg.WriteDate( 'FECHA', FECHA.Date );
      Reg.WriteTime( 'HORA', StrToTime( HORA.Text ) );
      Reg.WriteFloat( 'MARGEN', MARGEN.Value );
      Reg.CloseKey;
    end;
  finally
    Reg.Free;
  end;
end;

Espero sus respuestas gracias. por tomarse el tiempo de leer.
Responder Con Cita