procedure f_CloseProcess(p_ProcessName: String);<br>var<br> v_lppe :TProcessEntry32;<br> v_found :Boolean;<br> v_Hand :THandle;<br>begin<br> v_Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);<br> v_lppe.dwSize:=Sizeof(v_lppe);<br> v_found := Process32First(v_Hand,v_lppe);<br> while v_found do<br> begin<br> if StrPas(v_lppe.szExeFile)=PChar(p_ProcessName) then<br> TerminateProcess(OpenProcess(PROCESS_TERMINATE,false,v_lppe.th32ProcessID),1);<br> v_found := Process32Next(v_Hand,v_lppe);<br> end;<br>end;