获取ie弹窗句柄,关闭IE广告弹窗
Public Function EnumWndProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
Dim Title1 As String * 255 '处理前窗口标题
Dim Title2 As String '处理后窗口标题
Call GetWindowText(hwnd, Title1, 255&) '获取窗口标题
If (InStr(Title1, Chr(0&)) > 0&) Then
Title2 = Left(Title1, InStr(Title1, Chr(0&)) - 1&) '处理空白字符
If Len(Title2) > 0 Then '处理空字符
Debug.Print Title2
End If
End If
If (InStr(Title2, "http://adsrich.qq.com") > 0) Then
Click_Hnd hwnd
End If
'Click_Hnd hwnd, 10, 10
'Exit Function
EnumWndProc = True '继续下一个
End Function