为什么vb中sendmessage函数返回直总是0
保证过程全对.为什么vb中sendmessage函数返回直总是0???PrivateDeclareFunctionSendMessageLib"user32"Alias"...
保证过程全对.为什么vb中sendmessage函数返回直总是0???
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
Dim a, b, c, d As Long
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
请指点小第一二吧,我都弄了一天了就不行
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 Sub Command1_Click()
a = FindWindow("ThunderRT6FormDC", "Form1")
b = FindWindowEx(a, 0, "ThunderRT6CommandButton", "确定")
c = sendMessage(b, WM_LBUTTONDOWN, 0, 0)
d = sendMessage(b, WM_LBUTTONUP, 0, 0)
End Sub 展开
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
Dim a, b, c, d As Long
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
请指点小第一二吧,我都弄了一天了就不行
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 Sub Command1_Click()
a = FindWindow("ThunderRT6FormDC", "Form1")
b = FindWindowEx(a, 0, "ThunderRT6CommandButton", "确定")
c = sendMessage(b, WM_LBUTTONDOWN, 0, 0)
d = sendMessage(b, WM_LBUTTONUP, 0, 0)
End Sub 展开
2个回答
展开全部
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 Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Declare Function PostMessage Lib "user32" Alias "枝困慎PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function FindWindow Lib "user32"猛敬尺氏 Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 Sub Command1_Click()
Dim a As Long, b As Long, c As Long, d As Long
a = FindWindow("ThunderRT6FormDC", "Test")
b = FindWindowEx(a, 0, "ThunderRT6CommandButton", "确定")
c = SendMessage(b, WM_LBUTTONDOWN, 0, ByVal 0)
d = SendMessage(b, WM_LBUTTONUP, 0, ByVal 0)
End Sub
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Declare Function PostMessage Lib "user32" Alias "枝困慎PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function FindWindow Lib "user32"猛敬尺氏 Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 Sub Command1_Click()
Dim a As Long, b As Long, c As Long, d As Long
a = FindWindow("ThunderRT6FormDC", "Test")
b = FindWindowEx(a, 0, "ThunderRT6CommandButton", "确定")
c = SendMessage(b, WM_LBUTTONDOWN, 0, ByVal 0)
d = SendMessage(b, WM_LBUTTONUP, 0, ByVal 0)
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询