user TlHelp32 procedure DeleteInternat; var p: pProcessInfo; ContinueLoop: BOOL; FSnapshotHandle, hProcess: THandle; FProcessEntry32: TProcessEntry32;begin New(p); FSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); FProcessEntry32.dwSize:=Sizeof(FProcessEntry32); ContinueLoop:=Process32First(FSnapshotHandle,FProcessEntry32); while integer(ContinueLoop)<>0 do begin p.ExeFile:= FProcessEntry32.szExeFile; if UpperCase(p.ExeFile)='INTERNAT.EXE' then begin hProcess := OpenProcess(PROCESS_ALL_ACCESS, FALSE,FProcessEntry32. th32ProcessID); TerminateProcess(hProcess,0); end; ContinueLoop:=Process32Next(FSnapshotHandle,FProcessEntry32); end; CloseHandle(FSnapshotHandle); end;
定时检测internat.exe 中止这进程
Winexec('internat.exe',SW_HIDE);
只不过我有一次终止internat.exe后重执行internat.exe却发现输入法照样用不了了
注销系统才起作用
不过我那次也许是系统意外 你多试试看看
var
p: pProcessInfo;
ContinueLoop: BOOL;
FSnapshotHandle, hProcess: THandle;
FProcessEntry32: TProcessEntry32;begin
New(p);
FSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
FProcessEntry32.dwSize:=Sizeof(FProcessEntry32);
ContinueLoop:=Process32First(FSnapshotHandle,FProcessEntry32);
while integer(ContinueLoop)<>0 do
begin
p.ExeFile:= FProcessEntry32.szExeFile;
if UpperCase(p.ExeFile)='INTERNAT.EXE' then
begin
hProcess := OpenProcess(PROCESS_ALL_ACCESS, FALSE,FProcessEntry32. th32ProcessID);
TerminateProcess(hProcess,0);
end;
ContinueLoop:=Process32Next(FSnapshotHandle,FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;