unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Registry, StdCtrls, ShellApi;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
with Reg do
begin
RootKey := HKEY_CURRENT_USER;
OpenKey('Console', true);
WriteInteger('ScreenColors', StrToInt(Edit1.text));
Closekey;
Reg.Free;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.MaxLength := 10;
Caption := 'Value : 0 - 999999999';
Button1.Caption := 'Set';
Button2.Caption := 'Preview';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(handle,'open','C:\WINDOWS\system32\cmd.exe',nil,nil,SW_SHOW);
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Registry, StdCtrls, ShellApi;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
with Reg do
begin
RootKey := HKEY_CURRENT_USER;
OpenKey('Console', true);
WriteInteger('ScreenColors', StrToInt(Edit1.text));
Closekey;
Reg.Free;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.MaxLength := 10;
Caption := 'Value : 0 - 999999999';
Button1.Caption := 'Set';
Button2.Caption := 'Preview';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShellExecute(handle,'open','C:\WINDOWS\system32\cmd.exe',nil,nil,SW_SHOW);
end;
end.
No comments:
Post a Comment