好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 codebutcher 于 2013-4-1 15:00 编辑
代码如下:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,Registry, WinSkinData;
type
TForm2 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
SkinData1: TSkinData;
Button8: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Microsoft\Internet Explorer\Main',true) then
Reg.WriteString('Start Page','about:blank');
Application.MessageBox('你确定要设置IE主页为空白页吗?','警告', MB_YESNO);
Reg.Free;
end;
procedure TForm2.Button2Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Microsoft\Internet Explorer\Main',true) then
Reg.WriteString('Start Page','http://www.52pojie.cn');
Application.MessageBox('你确定要设置IE主页为吾爱破解论坛吗?','警告', MB_YESNO);
Reg.Free;
end;
procedure TForm2.Button3Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CURRENT_USER;
Reg.OpenKey('\Software\Policies\Microsoft',true);
Reg.CreateKey('Internet Explorer');
Reg.OpenKey('\Software\Policies\Microsoft\Internet Explorer',true);
Reg.CreateKey('Control Panel');
Reg.OpenKey('\Software\Policies\Microsoft\Internet Explorer\Control Panel',true);
Reg.WriteString('HomePage','1');
Reg.Free;
Application.MessageBox('你确定要锁定IE主页吗?','警告', MB_YESNO);
end;
procedure TForm2.Button4Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CURRENT_USER;
Reg.OpenKey('\Software\Policies\Microsoft\Internet Explorer\Control Panel',true);
Reg.DeleteValue('HomePage');
Reg.Free;
Application.MessageBox('IE主页锁定已解除!','恭喜你', MB_OK);
end;
procedure TForm2.Button5Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\System',True);
Reg.WriteInteger('DisableRegistryTools',1);
Reg.Free;
Application.MessageBox('你确定要锁定注册表吗?','警告', MB_YESNO);
end;
procedure TForm2.Button6Click(Sender: TObject);
var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Reg.RootKey:=HKEY_CURRENT_USER;
Reg.OpenKey( '\Software\Microsoft\Windows\CurrentVersion\Policies\System',True);
Reg.WriteInteger('DisableRegistryTools',0);
Reg.Free;
Application.MessageBox('注册表锁定解除成功!','恭喜你', MB_OK);
end;
procedure TForm2.Button7Click(Sender: TObject);
begin
Application.MessageBox('','', MB_OK);
end;
procedure TForm2.Button8Click(Sender: TObject);
begin
Close;
end;
end.
//备注
"C:\Program Files\Embarcadero\RAD Studio\9.0\bin\bds.exe" -pDelphi -np
启动参数:
C:\Program Files\Embarcadero\RAD Studio\9.0\bin\bds.exe" -ns -np -pDelphi
可选参数:
跳过Delphi启动界面(no splash)
-ns
启动时不打开空项目(no project)
-np
在工具条上显示内存使用情况
-HM
内存校验,在工具条上显示内存错误信息
-HV
关于信息提示窗口也可以用Application.MessageBox();做。
将ShowMessage();改用Application.MessageBox();
Application.MessageBox('成功去掉!','操作完成');
Application.MessageBox('成功复原!','操作完成');
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|