正文

AutoIT写的禁止QQ运行的程序代码(怎么禁止qq运行)难以置信

文章摘要

这段代码使用C语言通过`winmgmts`管理服务和`ProcessExists`接口来实现对QQ进程的监控和管理。代码首先检查并关闭已存在的QQ进程,然后通过`Objeto`获取所有正在运行的进程,使用`ExecNotificationQuery`实时监控并终止任何与QQ相关的进程。其核心功能是确保QQ进程在运行时被及时终止,防止潜在的安全漏洞或恶意行为。代码逻辑清晰,主要专注于进程监控与终止操作。

 if ProcessExists(“qq.exe”) then 

                $QQPID = ProcessExists(“qq.exe”)

                ProcessClose ($QQPID)

        endif

===============================================================

Set objWMIService = GetObject(“winmgmts:” & “{impersonationLevel=impersonate}!\\.\root\cimv2”)

Set colMonitoredProcesses = objWMIService.ExecNotificationQuery(“select * from __instancecreationevent within 1 where TargetInstance isa ‘Win32_Process'”)

i = 0

Do While i = 0

        Set objLatestProcess = colMonitoredProcesses.NextEvent

        strPrs = LCase(objLatestProcess.TargetInstance.Name)

        If InStr(strPrs,”qq”) <> “0” Then

                objLatestProcess.TargetInstance.Terminate

        End If

        Set objLatestProcess = Nothing

Loop