Código
// neste form crie alguns labels
// e siga as instuções a seguir
// deixe o mais parecido possível
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls,Registry;
// Acima, Tudo o que a janela 2 ... Precisa para funcionar corretamente
type
TForm2 = class(TForm) // essa parte o delphi faz sozinho
Label1: TLabel; // não se preocupe
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Button1: TButton;
GroupBox1: TGroupBox;
Timer1: TTimer;
Memo1: TMemo;
Label6: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label12: TLabel;
Timer2: TTimer;
Label7: TLabel;
Label13: TLabel;
Image1: TImage;
Image2: TImage;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
// Acima todos os componentes da janela sobre...
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
reg: TRegistry; // esta parte vc tem que digtar
Regi: Tregistry;
S: String;
T: String;
U: String;
Y: String;
V: String; // até aqui
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
// este é o evento on Show
begin
Reg:= Tregistry.Create;
With Reg do
begin
rootKey:=HKEY_LOCAL_MACHINE;
openKey('SOFTWAREMicrosoftWindows NTCurrentVersion',false);
S:=ReadString('ProductName');
T:=ReadString('CSDVersion');
U:=ReadString('RegisteredOwner');
Y:=ReadString('RegisteredOrganization');
CloseKey;
end;
begin
regi:=tRegistry.Create;
With Regi do
Begin
rootKey:=HKEY_LOCAL_MACHINE;
OpenKey('HardwareDescriptionSystemCentralProcessor ',false);
V:=ReadString('ProcessornameString');
CloseKey;
end;
Label6.Caption:= ' Sistema Operacional: ' + S + ' (' + T + ')';
Label7.Caption:= ' Registrado para : ' + u;
Label8.Caption:= ' Organização: ' + y;
Label12.Caption:= 'Processador:'+ V;
end;
// O Código acima busca informações no registro do Windows
// Para exibir na janela sobre, informações a serca do
// Nome e service pack do Windows
// proprietário e organização cadastrados
// marca e modelo do processador
end;
procedure TForm2.Button1Click(Sender: TObject); // Codigo do Botão OK
begin
Form2.Close;
end;
end.
espero ter ajudado
qq coisa
murilof.almeida@hotmail.com
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009