如何提交网页弹出的对话框
怎么提交网页弹出的对话框?
某个网页弹出个对话框窗口,上面有确定和取消按钮。
怎么点击这个对话框里的按钮呢?
webbrowser好像只能处理网页里面的元素吧?
难道webbrowser的子窗口之类的属性?不懂啊,学习学习,
------解决方案--------------------
class #32770
某个网页弹出个对话框窗口,上面有确定和取消按钮。
怎么点击这个对话框里的按钮呢?
webbrowser好像只能处理网页里面的元素吧?
难道webbrowser的子窗口之类的属性?不懂啊,学习学习,
------解决方案--------------------
class #32770
- VB code
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 Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" (ByVal hWnd As Long, _ ByVal wMsg As Long, ByVal wParam As Long, _ ByVal lParam As String) As Long Private Declare Function FindWindow Lib "user32" _ Alias "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Function CloseSystemConfirmDlg() As Boolean Dim IEDialogHwnd As Long IEDialogHwnd = FindWindow("#32770", "Microsoft Internet Explorer") If IEDialogHwnd = 0 Then '不同版本的IE标题有差异 IEDialogHwnd = FindWindow("#32770", "Windows Internet Explorer") End If If IEDialogHwnd Then CloseSystemConfirmDlg = True Call SendMessage(FindWindowEx(IEDialogHwnd, ByVal 0&, "Button", "确定"), &HF5, 0, 0) Call SendMessage(FindWindowEx(IEDialogHwnd, ByVal 0&, "Button", "确定"), &HF5, 0, 0) End If End Function