为什么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
展开
 我来答
tianqing20wen

2009-08-03 · TA获得超过2.4万个赞
知道大有可为答主
回答量:8226
采纳率:88%
帮助的人:5097万
展开全部
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
gohoosky
2009-08-03 · TA获得超过323个赞
知道小有建树答主
回答量:235
采纳率:0%
帮助的人:169万
展开全部
你贴出你的程序?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式