找回密码
 加入
搜索
查看: 8355|回复: 19

[AU3基础] 如果杀掉指定进程弹出来的窗口。

 火.. [复制链接]
发表于 2011-5-26 22:27:04 | 显示全部楼层 |阅读模式
查了很多资料,也得不到答案,进程名是explorer.exe  弹出窗口是"Microsoft Internet Explore“

如果写一个监视程序,explorer.exe弹出"Microsoft Internet Explore"就杀掉这个窗口呢?
发表于 2011-5-26 22:40:41 | 显示全部楼层
回复 1# 0758
首先 我没有轻视楼主的意思,看你的等级比较低,可能接触AU3不长时间,你要的应该是阻挡网页弹广告的东西吧,用AU3写起来比较麻烦的,不如找个现成的浏览器插件!另外,有些不正规网站弹的东西很难阻挡,这个弹网站也是门大学问的哦,没见阻挡弹网页的插件很多,但是有些就是杀不掉么!
道高一尺魔高一丈啊!呵呵
 楼主| 发表于 2011-5-26 22:44:51 | 显示全部楼层
只是想杀掉那个"Microsoft Internet Explore" 那个窗口,是explorer.exe弹出来的,
发表于 2011-5-26 22:53:54 | 显示全部楼层
本帖最后由 love5173 于 2011-5-26 22:55 编辑

因为看不见你说的窗口具体是什么,只能给你提示了
while 1
winwait("Microsoft Internet Explore" ,"")
winclose("Microsoft Internet Explore" ,"")
wend
上面尽量用winwait来等待,不要用WinExists来加大cpu的负荷
 楼主| 发表于 2011-5-27 16:34:52 | 显示全部楼层
现在最麻烦的是由explorer.exe这个进程弹出来的 Microsoft Internet Explore这个窗口,如果是其他窗口弹出来的,以上代码,就关错了,
发表于 2011-5-27 17:10:08 | 显示全部楼层
while 1
ProcessExists("IEXPLORE.exe")
wend
发表于 2011-5-27 20:48:35 | 显示全部楼层
回复 2# love5173


    突然想到,可以用AU3IE插件吗 ?
如果这样的话,楼主的问题就迎刃而解了?
发表于 2011-5-27 22:34:54 | 显示全部楼层
现在最麻烦的是由explorer.exe这个进程弹出来的 Microsoft Internet Explore这个窗口,如果是其他窗口弹出来 ...
0758 发表于 2011-5-27 16:34
while 1
        If ProcessExists("explorer.exe") then
       winwait("Microsoft Internet Explore" ,"")
       winclose("Microsoft Internet Explore" ,"")
        EndIf
    Sleep(10) ;减轻循环过程中等待的CPU负担
wend
 楼主| 发表于 2011-5-27 22:50:31 | 显示全部楼层
系统内核进程explorer.exe开机就存在的,现在就是要判断这个"Microsoft Internet Explore" 的窗口是不是由explorer.exe产生的,如果是就杀掉窗口,如果不是就不理会。
发表于 2011-5-27 23:35:01 | 显示全部楼层
_WinAPI_EnumProcessWindows()枚举该进程的窗口
 楼主| 发表于 2011-5-28 20:53:09 | 显示全部楼层
楼上的可不可以详细一点?
发表于 2011-5-29 00:01:51 | 显示全部楼层
应该可以由窗口获取对应进程的PID和进程名
发表于 2011-5-30 00:37:31 | 显示全部楼层
#Include <Array.au3>
#Include <WinAPIEx.au3>

$pid = ProcessExists("explorer.exe")

Global $Data = _WinAPI_EnumProcessWindows($pid)
Global $titles[10]

For $i=1 To $Data[0][0]
        Local $title = WinGetTitle($Data[$i][0])
        If StringInStr($title,"Microsoft Internet Explore") Then WinClose($Data[$i][0])
        _ArrayPush($titles,$title)
Next
_ArrayDisplay($titles)
发表于 2011-5-30 01:50:51 | 显示全部楼层
如果确定是explorer弹出的,建议老老实实先留着吧,删错了会很麻烦的,而且如果是挂explorer的窗口后台极有可能还挂着winlogon
发表于 2011-5-30 04:59:22 | 显示全部楼层
wingetprcoess不是可以获取进程pid嘛
然后再根据进程pid反查进程名称.

如果发现是explorer.exe生成的窗口.直接winclose不就over了?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 04:35 , Processed in 0.085724 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表