主题:进来坐坐..........
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Registry, StdCtrls, Buttons;
type
TForm1 = class(TForm)
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
path='\Software\microsoft\windows\currentVersion\Policies\Explorer';
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
Buffer:Dword;
Reg:TRegistry; //这个什么意思啊
begin
Reg:=Tregistry.Create;
Reg.RootKey:=HKey_current_user; 还有这个什么意思啊,要详细点啊。
Reg.OpenKey(path,True);
buffer:=4;
Reg.WriteBinaryData('NoDrives',Buffer,Sizeof(Buffer));
Reg.Free;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
var
Buffer:Dword;
Reg:TRegistry;
begin
Reg:=Tregistry.Create;
Reg.RootKey:=HKey_current_user;
Reg.OpenKey(path,True);
Reg.DeleteValue('NoDrives');
Reg.Free;
end;
end.
[em6]
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Registry, StdCtrls, Buttons;
type
TForm1 = class(TForm)
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
const
path='\Software\microsoft\windows\currentVersion\Policies\Explorer';
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
Buffer:Dword;
Reg:TRegistry; //这个什么意思啊
begin
Reg:=Tregistry.Create;
Reg.RootKey:=HKey_current_user; 还有这个什么意思啊,要详细点啊。
Reg.OpenKey(path,True);
buffer:=4;
Reg.WriteBinaryData('NoDrives',Buffer,Sizeof(Buffer));
Reg.Free;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
var
Buffer:Dword;
Reg:TRegistry;
begin
Reg:=Tregistry.Create;
Reg.RootKey:=HKey_current_user;
Reg.OpenKey(path,True);
Reg.DeleteValue('NoDrives');
Reg.Free;
end;
end.
[em6]