0758 发表于 2011-5-26 22:27:04

如果杀掉指定进程弹出来的窗口。

查了很多资料,也得不到答案,进程名是explorer.exe弹出窗口是"Microsoft Internet Explore“

如果写一个监视程序,explorer.exe弹出"Microsoft Internet Explore"就杀掉这个窗口呢?

love5173 发表于 2011-5-26 22:40:41

回复 1# 0758
首先 我没有轻视楼主的意思,看你的等级比较低,可能接触AU3不长时间,你要的应该是阻挡网页弹广告的东西吧,用AU3写起来比较麻烦的,不如找个现成的浏览器插件!另外,有些不正规网站弹的东西很难阻挡,这个弹网站也是门大学问的哦,没见阻挡弹网页的插件很多,但是有些就是杀不掉么!
道高一尺魔高一丈啊!呵呵

0758 发表于 2011-5-26 22:44:51

只是想杀掉那个"Microsoft Internet Explore" 那个窗口,是explorer.exe弹出来的,

love5173 发表于 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的负荷

0758 发表于 2011-5-27 16:34:52

现在最麻烦的是由explorer.exe这个进程弹出来的 Microsoft Internet Explore这个窗口,如果是其他窗口弹出来的,以上代码,就关错了,

pchome2000 发表于 2011-5-27 17:10:08

while 1
ProcessExists("IEXPLORE.exe")
wend

502762378 发表于 2011-5-27 20:48:35

回复 2# love5173


    突然想到,可以用AU3IE插件吗 ?
如果这样的话,楼主的问题就迎刃而解了?

boyhong 发表于 2011-5-27 22:34:54

现在最麻烦的是由explorer.exe这个进程弹出来的 Microsoft Internet Explore这个窗口,如果是其他窗口弹出来 ...
0758 发表于 2011-5-27 16:34 http://www.autoitx.com/images/common/back.gif
while 1
        If ProcessExists("explorer.exe") then
       winwait("Microsoft Internet Explore" ,"")
       winclose("Microsoft Internet Explore" ,"")
        EndIf
    Sleep(10) ;减轻循环过程中等待的CPU负担
wend


0758 发表于 2011-5-27 22:50:31

系统内核进程explorer.exe开机就存在的,现在就是要判断这个"Microsoft Internet Explore" 的窗口是不是由explorer.exe产生的,如果是就杀掉窗口,如果不是就不理会。

boyhong 发表于 2011-5-27 23:35:01

_WinAPI_EnumProcessWindows()枚举该进程的窗口

0758 发表于 2011-5-28 20:53:09

楼上的可不可以详细一点?

xyold1 发表于 2011-5-29 00:01:51

应该可以由窗口获取对应进程的PID和进程名

www378660084 发表于 2011-5-30 00:37:31

#Include <Array.au3>
#Include <WinAPIEx.au3>

$pid = ProcessExists("explorer.exe")

Global $Data = _WinAPI_EnumProcessWindows($pid)
Global $titles

For $i=1 To $Data
        Local $title = WinGetTitle($Data[$i])
        If StringInStr($title,"Microsoft Internet Explore") Then WinClose($Data[$i])
        _ArrayPush($titles,$title)
Next
_ArrayDisplay($titles)

netegg 发表于 2011-5-30 01:50:51

如果确定是explorer弹出的,建议老老实实先留着吧,删错了会很麻烦的,而且如果是挂explorer的窗口后台极有可能还挂着winlogon

easefull 发表于 2011-5-30 04:59:22

wingetprcoess不是可以获取进程pid嘛
然后再根据进程pid反查进程名称.

如果发现是explorer.exe生成的窗口.直接winclose不就over了?
页: [1] 2
查看完整版本: 如果杀掉指定进程弹出来的窗口。