vb 用句柄和SendMessage关闭指定窗口 15
DeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVal...
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)
Declare Function SendMessageBynum& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Declare Function SendMessageByString& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String)
Private Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long) As Long
Dim dlghwnd As Long
Dim buttonhwnd As Long
dlghwnd = FindWindow("#32770", "Windows Internet Explorer")
buttonhwnd = GetDlgItem(dlghwnd, &O1) '其中的2,用spy++获得
SendMessage buttonhwnd, BM_CLICK, 0&, ByVal 0&
这是我的代码,我是想关闭是在百度知道里回答问题的时候当在回答窗口中输入答案但是没点提交而打开其他的页面时弹出的窗口,但是就是没反应 展开
Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any)
Declare Function SendMessageBynum& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Declare Function SendMessageByString& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String)
Private Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long) As Long
Dim dlghwnd As Long
Dim buttonhwnd As Long
dlghwnd = FindWindow("#32770", "Windows Internet Explorer")
buttonhwnd = GetDlgItem(dlghwnd, &O1) '其中的2,用spy++获得
SendMessage buttonhwnd, BM_CLICK, 0&, ByVal 0&
这是我的代码,我是想关闭是在百度知道里回答问题的时候当在回答窗口中输入答案但是没点提交而打开其他的页面时弹出的窗口,但是就是没反应 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询