1,502
社区成员
发帖
与我相关
我的任务
分享
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