//关闭***.exe
sshandle:=createtoolhelp32snapshot(TH32CS_SNAPALL,0);
found:=process32first(sshandle,lppe);
// str:=extractfilepath(paramstr(0))+'client.exe';
while found do
begin
//进行你的处理其中lppe.szExefile就是程序名。
str:=uppercase(extractfilename(lppe.szExeFile));
if str='***.EXE' then
begin
hh:=OpenProcess(PROCESS_ALL_ACCESS,true,lppe.th32ProcessID);
TerminateProcess(hh,0);
end;
found:=process32next(sshandle,lppe);
end;