Option   Explicit Private   Declare   Function   GetForegroundWindow   Lib   "user32"   ()   As   Long 
Private   Declare   Function   GetWindowText   Lib   "user32"   Alias   "GetWindowTextA"   (ByVal   hwnd   As   Long,   ByVal   lpString   As   String,   ByVal   cch   As   Long)   As   Long 
Private   Declare   Function   FindWindowEx   Lib   "user32"   Alias   "FindWindowExA"   (ByVal   hWnd1   As   Long,   ByVal   hWnd2   As   Long,   ByVal   lpsz1   As   String,   ByVal   lpsz2   As   String)   As   Long 
Dim   hwd,   hwd1,   zi   As   Long 
Dim   biaoti   As   String 
Dim   x   As   New   WebBrowser 
Dim   WithEvents   eventIE               As   WebBrowser_V1 
'Dim   WithEvents   InternetExplorer1   As   InternetExplorer 
Private   Sub   Timer1_Timer() 
        Dim   doc 
        Dim   wangye 
        Dim   zzi   As   Long 
        Dim   iewin           As   New   ShellWindows 
        Dim   ie           As   InternetExplorer 
        Dim   ietemp           As   InternetExplorer 
        
'         Set   InternetExplorer1   =   New   InternetExplorer         hwd   =   GetForegroundWindow() 
        
        Label1.Caption   =   hwd 
        biaoti   =   Space(255) 
        zi   =   GetWindowText(hwd,   biaoti,   255) 
        Label2.Caption   =   biaoti 
        Label3.Caption   =   "不是浏览器" 
        If   InStr(biaoti,   "Internet   Explorer")   <>   0   Then 
                Label3.Caption   =   "找到浏览器" 
  
                这里   要如何操作IE,   可能会有1个,2个,或者随时会打开多个IE,我想得到每一个IE窗口的标题并修改它    
                   并 能够 响应 每一个 IE窗口 标题变化的事件(就是打开新页面的事件)

        End   If 
        
End   Sub

解决方案 »

  1.   

    http://zhidao.baidu.com/question/32820795.html
    http://www.thousandvb.com/html/gb/weekly/day000307.htm
      

  2.   

    有人在么,
    csdn 的兄弟  都放假了么
      

  3.   

    楼主思路不太好。最好先看看一些关于操作IE的文章,你的窗口获取是使用API来实现的,会导致你的识别工作很麻烦,实际上应该获从COM入手(showXXXXXX),从中区分出IE还是资源管理器还是其他窗口,得到IE窗口后,可以直接用COM来获取其打开新窗口事件(一个接口而已)。。这样就简单的多了你可以参考我的博客上的一些文章,虽然不是针对这个的,但是代码都有的。
    http://blog.csdn.net/zcsor