Buscar

chave de registro para mu Online

Código

unit Unit1;

interface

uses
  Windows, Registry, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, ComCtrls, jpeg;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Panel1: TPanel;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    GroupBox4: TGroupBox;
    Edit1: TEdit;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    TrackBar1: TTrackBar;
    Label1: TLabel;
    Label2: TLabel;
    Image2: TImage;
    Image3: TImage;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Image2Click(Sender: TObject);
    procedure Image3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  Registro: TRegistry;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
form1.Close;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
//Abrir o registro do Windows pelo delphi.
Registro := TRegistry.Create;

//Abre Hkey
Registro.RootKey := HKEY_CURRENT_USER;

//Abre Caminho
Registro.OpenKey('SoftwareWebzenMuConfig', True);

//Le o ID
Edit1.Text := Registro.ReadString('ID');


//Le o Resolução
if  registro.ReadInteger('Resolution') = 0 then begin RadioButton1.Checked := true;end;
if  registro.ReadInteger('Resolution') = 1 then begin RadioButton2.Checked := true;end;
if  registro.ReadInteger('Resolution') = 2 then begin RadioButton3.Checked := true;end;

//Le Som/Musica On/Off
if  registro.ReadInteger('SoundOnOff') = 0 then begin CheckBox1.Checked := false; end;
if  registro.ReadInteger('SoundOnOff') = 1 then begin CheckBox1.Checked := True; end;

if  registro.ReadInteger('MusicOnOff') = 0 then begin CheckBox1.Checked := false; end;
if  registro.ReadInteger('MusicOnOff') = 1 then begin CheckBox1.Checked := True; end;

//Le Volume Level
TrackBar1.Position := Registro.ReadInteger('VolumeLevel');

//Fechar caminho
Registro.CloseKey;

//Fechar o registro do Windows pelo delphi.
Registro.Free;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
//Abrir o registro do Windows pelo delphi.
Registro := TRegistry.Create;

//Abre Hkey
Registro.RootKey := HKEY_CURRENT_USER;

//Abre Caminho
Registro.OpenKey('SoftwareWebzenMuConfig', True);

//Escrevendo Novo acount ID.
Registro.WriteString('ID', Edit1.Text); //Escreve o ID caso voce tenha mudado.

//Escrevendo Som e Musica On/Off.
if CheckBox1.Checked Then Registro.WriteInteger('SoundOnOff', 1)
else Registro.WriteInteger('SoundOnOff', 0);

if CheckBox1.Checked Then Registro.WriteInteger('MusicOnOff', 1)
else Registro.WriteInteger('MusicOnOff', 0);

//Escrevendo o Volume.
Registro.WriteInteger('VolumeLevel', Trackbar1.Position);

//Fechar Caminho
Registro.CloseKey;

//Fechar o registro do Windows pelo delphi.
Registro.Free;

Form1.Close;
end;

procedure TForm1.Image2Click(Sender: TObject);
begin
//Abrir o registro do Windows pelo delphi.
Registro := TRegistry.Create;

//Abre Hkey
Registro.RootKey := HKEY_CURRENT_USER;

//Abre Caminho
Registro.OpenKey('SoftwareWebzenMuConfig', True);

//Escrevendo Novo acount ID.
Registro.WriteString('ID', Edit1.Text); //Escreve o ID caso voce tenha mudado.

//Escrevendo Som e Musica On/Off.
if CheckBox1.Checked Then Registro.WriteInteger('SoundOnOff', 1)
else Registro.WriteInteger('SoundOnOff', 0);

if CheckBox1.Checked Then Registro.WriteInteger('MusicOnOff', 1)
else Registro.WriteInteger('MusicOnOff', 0);

//Escrevendo o Volume.
Registro.WriteInteger('VolumeLevel', Trackbar1.Position);

//Fechar Caminho
Registro.CloseKey;

//Fechar o registro do Windows pelo delphi.
Registro.Free;

Form1.Close;
end;

procedure TForm1.Image3Click(Sender: TObject);
begin
form1.Close;
end;

end.

Publicidade

Vote na dica




Quantidade de votos: 0 votos
Aceitação: 0%


Detalhes da dica

Categoria: Arquivos
Adicionada dia: 15/02/11
Por: Cezar
Visualizada: 13719 vezes

Planeta Delphi - Tudo sobre programação Delphi Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009