VB中如何虚拟按下鼠标左键
展开全部
用api
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
const
wm_lbuttondown
=
&h201
private
const
wm_lbuttonup
=
&h202
private
sub
command1_click()
postmessage
command2.hwnd,
&h201,
0&,
0&
postmessage
command2.hwnd,
&h202,
0&,
0&
end
sub
private
sub
com缉梗光妓叱幻癸潍含璃mand2_click()
static
i
as
long
i
=
i
+
1
print
"command2按钮点了"
&
i
&
"次"
end
sub
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
const
wm_lbuttondown
=
&h201
private
const
wm_lbuttonup
=
&h202
private
sub
command1_click()
postmessage
command2.hwnd,
&h201,
0&,
0&
postmessage
command2.hwnd,
&h202,
0&,
0&
end
sub
private
sub
com缉梗光妓叱幻癸潍含璃mand2_click()
static
i
as
long
i
=
i
+
1
"command2按钮点了"
&
i
&
"次"
end
sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询