unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Registry, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
//////////////////////////////////////////////////////////////////////////////
//10.用某一程序替换windows启动时启动的Explorer.ext
//////////////////////////////////////////////////////////////////////////////
procedure DisplaceExplorer(FileName:String);
var
Form1: TForm1;
implementation
{$R *.dfm}
//////////////////////////////////////////////////////////////////////////////
//10.用某一程序替换windows启动时启动的Explorer.exe
//////////////////////////////////////////////////////////////////////////////
procedure DisplaceExplorer(FileName:String);
var
Regf:TRegistry;
begin
Regf:=TRegistry.Create;
Regf.RootKey:=HKEY_LOCAL_MACHINE;
if Length(FileName)>0 then
try
RegF.OpenKey('SOFTWARE/Microsoft/Windows NT/CurrentVersion/Winlogon',false);
RegF.WriteString('Shell',FileName);
except
end;
RegF.CloseKey;
RegF.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
//将你的程序拷贝到 windows目录下,然后执行下面的代码
DisplaceExplorer('Explorer.exe,你的程序.exe');
end;
end.