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
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
http://www.thousandvb.com/html/gb/weekly/day000307.htm
csdn 的兄弟 都放假了么
http://blog.csdn.net/zcsor