AutoIT写的禁止QQ运行的程序代码

View Code
 1 if ProcessExists("qq.exe") then 
 2 $QQPID = ProcessExists("qq.exe"
 3 ProcessClose ($QQPID) 
 4 endif 
 5 
 6 
 7 =============================================================== 
 8 Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2"
 9 Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent within 1 where TargetInstance isa 'Win32_Process'"
10 = 0 
11 Do While i = 0 
12 Set objLatestProcess = colMonitoredProcesses.NextEvent 
13 strPrs = LCase(objLatestProcess.TargetInstance.Name) 
14 If InStr(strPrs,"qq"<> "0" Then 
15 objLatestProcess.TargetInstance.Terminate 
16 End If 
17 Set objLatestProcess = Nothing 
18 Loop 
19 
2
posted @ 2011-06-02 11:24  fxcl  阅读(408)  评论(0编辑  收藏  举报