用 WebBrowers 遇到来自网页的消息弹出后中断程序的运行,我该怎么做?
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Sub Command1_Click()
Web1.Document.getelementbyid("name").Value = Text1.Text
Web1.Document.getelementbyid("password").Value = Text2.Text
Dim js As String
js = "javascript:submitt()"
Web1.Navigate js
End Sub
Private Sub Form_Load()
Web1.Navigate ("http://shgdyxx.)
DoEvents
While Web1.Busy
DoEvents
Wend
End Sub
请问:
Dim hwnd2 As Long
While hWnd2 = 0
hwnd2 = FindWindow(vbNullString, "来自网页的消息")
Wend
MsgBox hwnd2
语句应该放在哪里?因为是用vb的WebBrowser做的,弹出来“来自网页的消息”影响到程序的运行了,我该怎么做?别告诉我hook 我不会。
[ 本帖最后由 pipiqi1975 于 2014-10-13 19:02 编辑 ]