如何不让某个程序或进程运行:100分!!!!(100分)

  • 主题发起人 主题发起人 the899
  • 开始时间 开始时间
T

the899

Unregistered / Unconfirmed
GUEST, unregistred user!
各位老大:
如何监控系统,如果发现某个进程或程序运行就立即终止它?
 
在xp里按ctrl+shift+del
 
var
hcrrentwindow:hwnd;
sztext:array[0..254] of char;
s:string;
begin
hcrrentwindow:=GetWindow(handle,GW_HWNDFIRST);
while hcrrentwindow<>0 do
begin
if GetWindowtext(hcrrentwindow,@sztext,255)>0 then
begin
s:=strpas(@sztext);
if pos('Microsoft Excel',s)<>0 then//如果发现含有Microsoft Excel的窗口将其关闭。
SendMessage(hcrrentwindow,WM_CLOSE,0,0);
Memo1.Lines.Add(s);
end;
hcrrentwindow:=GetWindow(hcrrentwindow,GW_HWNDNEXT);
end;
end;
 
没有作过,不过我是这样想的。
做一个service.搞一个线程,不断循环查找进程。如果是你要找的进程就把它kill掉。

应该还有更好的方法,你自己想想。
上面的方法的实现代码,去找找吧。
 
后退
顶部