vb中webbrowser打开网页的弹出对话框...如何 发送"确定"啊
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) 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
Private Const BM_CLICK = &HF5
Private Sub Timer1_Timer()
Dim pk&, pp&
'pk = FindWindow(vbNullString, 对话框名) 查找窗体,就是警告对话筐
'pp = FindWindowEx(pk, ByVal 0&, "Button", 按钮名) 查找指定窗题上的指定button
'SendMessage pp, BM_CLICK, 0, 0 给button发送按下消息
pk = FindWindow("Microsoft Internet Explorer", vbnnullstring)
pp = FindWindowEx(pk, 1&, "确定")
SendMessage pp, BM_CLICK, 0, 0
Timer1.Enabled = False
End Sub
为什么不能用啊? 请教高手指点