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
Reg := TRegistry.Create;
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.