哎!
虎落平川被欺!
a程序把 GetProcessID()写入临时文件!
var
f:file of byte;
i:thandle;
begin
assignfile(f,'c:/pid.');
rewrite(f,1);
if ioresult=0 then
begin
i:=getcurrentprocessid();
blockwrite(f,i,sizeof(thandle));
closefile(f);
end;
end;
b程序把读取临时文件!
var
f:file of byte;
i:thandle;
begin
assignfile(f,'c:/pid.');
reset(f,1);
if ioresult=0 then
begin
blockread(f,i,sizeof(thandle));
closefile(f);
end;
end;
terminateProcess(OpenProcess(PROCESS_TERMINATE,false,i),0);
用API也可以阿,但是我又不知道你的标题!
sendmessage(FindWindow(nil,pchar('你的标题')),wm_destory,0,0);