VB编写一个鼠标自动点击可mouse_event为什么不起作用

问题描述

各位大哥帮我看看看谢谢了为什么mouse_event不起点击作用拉,Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())和Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0)都试过了不行各位大哥帮帮忙呀PrivateConstMOUSEEVENTF_ABSOLUTE=&H8000'absolutemovePrivateConstMOUSEEVENTF_LEFTDOWN=&H2'leftbuttondownPrivateConstMOUSEEVENTF_LEFTUP=&H4'leftbuttonupPrivateConstMOUSEEVENTF_MIDDLEDOWN=&H20'middlebuttondownPrivateConstMOUSEEVENTF_MIDDLEUP=&H40'middlebuttonupPrivateConstMOUSEEVENTF_MOVE=&H1'mousemovePrivateConstMOUSEEVENTF_RIGHTDOWN=&H8'rightbuttondownPrivateConstMOUSEEVENTF_RIGHTUP=&H10'rightbuttonupPrivateConstKEYEVENTF_KEYUP=&H2PrivateSubTimer1_Timer()DimbiaAsPOINTAPIDimdAsPOINTAPIDimhwnd,thisAsLong'储存FindWindow函数返回的句柄hwnd=FindWindow(vbNullString,"")'取得进程标识符CallGetWindowThreadProcessId(hwnd,this)'只要把WindowsMediaPlayer换成游戏的名称就可了!Ifhwnd=0ThenLabel1.Caption="游戏未运行"ElseLabel1.Caption="游戏已运行"EndIfGetCursorPosbiaIfi>20Theni=0i=i+1Elsei=i+1EndIfSelectCaseiCase1:CallSetCursorPos(150,120)'''Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case2:CallSetCursorPos(150,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case3:CallSetCursorPos(350,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case4:CallSetCursorPos(350,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case5:CallSetCursorPos(550,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case6:CallSetCursorPos(550,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case7:CallSetCursorPos(750,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case8:CallSetCursorPos(750,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case9:CallSetCursorPos(950,120)''Callkeybd_event(65,0,0,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case10:CallSetCursorPos(950,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case11:CallSetCursorPos(1014,667)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case12:CallSetCursorPos(950,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case13:CallSetCursorPos(750,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case14:CallSetCursorPos(750,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case15:CallSetCursorPos(550,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case16:CallSetCursorPos(550,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case17:CallSetCursorPos(350,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case18:CallSetCursorPos(350,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case19:CallSetCursorPos(150,600)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())Case20:CallSetCursorPos(150,120)'Callkeybd_event(65,0,0,0)'Callkeybd_event(65,0,DEYEVENTF_KEYUP,0)Callmouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,GetMessageExtraInfo())Callmouse_event(MOUSEEVENTF_LEFTUP,0,0,0,GetMessageExtraInfo())EndSelectEndSub

解决方案

解决方案二:
路过帮顶=============11月6日,论坛升级公告,积分已经做了调整!http://topic.csdn.net/u/20081107/11/b27dc75f-14b1-4594-9de3-5b18d9e36a11.html此次调整增加了两个新的可用分获取渠道:1:帖子被推荐(加精)后,帖主可以获得88分的可用分奖励;2:帖子结帖后会返还帖主50%的悬赏分,无满意结帖不返还分数;3:接下来会不断增加新的可用分获取途径,比如参与活动赠送等,请大家多关注;

时间: 2024-10-26 07:41:08

VB编写一个鼠标自动点击可mouse_event为什么不起作用的相关文章

这种程序有可能实现吗?鼠标自动点击网页广告。

问题描述 这种程序有可能实现吗?鼠标自动点击网页广告.模拟用户打开网页再点击网页上的广告,这些广告一般是JS输出或IFRAME嵌套的,有需要的话可以放在指定的DIV里,或指定广告的坐标,C#可以实现吗? 解决方案 解决方案二:日!前几天中了个广告病毒,就是在滚动鼠标滑轮的时候自动点击over过的连接.lz要做病毒?解决方案三:不是病毒啦,解决方案四:告诉你几个可能用到的windowsapi,具体用法自己去找找看1.keybd_event模拟键盘输入2.mouse_event模拟鼠标输入3.Set

用VB编写一个屏幕颜色拾取器

设计状态下窗口中添加两个Frame控件做为容器,加入二个PictureBox控件,一个PictureClip控件(其中装入一个设计好的鼠标指针Mask图片),两个文本框控件,几个Label控件,两个Command控件,一个CheckBox控件. 代码如下: Option Explicit Private Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Long) As LongPrivate Declare Functi

VB编写一个能显示百分比的自定义进度条控件

百分比|控件|显示 运行效果: 设计方法: 1.在UserControl中添加一个Label控件Label1,将它设为平面,用来做外框.添加两个PictureBox控件PictureBox1做为进度指示,PictureBox2控件做为控件背景. 2.加入以下代码 Option Explicit '定义私有变量用于存储属性值Private mvarMax As LongPrivate mvarMin As LongPrivate mvarValue As Long Private Rate As

用VB编写一个可以在ASP环境下调用的运行CMD命令的组件

有时我们在管理服务器时为了安全起见会禁用Windows Scripting Host,这样能防止某些不法用户利用WSH生成一个WebShell,对服务器造成很大的安全隐患.但如果我们又想禁用WSH,又想使用自己的WebShell用于服务器的管理怎么办呢?这里介绍了一种实现ASP中运行CMD并显示结果的组件编程.希望对大家能有所帮助. 首先我们新建一个ActiveDLL工程,命名为ASPCMD,新建的类命名为CMDShell.在"Project"的"Referenct"

懒就要懒到底——鼠标自动点击(含时间判断)_javascript技巧

其实老早之前就已经做完了,这次稍微改进一下浏览地址:http://www.healdream.com/upload/html/autoclick.html 复制代码 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=&qu

请教一下。 我用vb编写了一个 数据库+发帖功能(自动填写表单) 。

问题描述 请教一下.我用vb编写了一个数据库+发帖功能(自动填写表单).但是,要发帖就得用电脑,真麻烦.现在像用android的手机(g7)发帖.我自己的资源.1,正在看java的教材.继承,接口,io,容器这些都看得7788啦.自学能力还行吧.2,然后希望把数据库放到网上.(用java的jsp?还是用去学学php呢?3,然后如果用手机发帖是登陆我的网站?如果是你,有什么好的思路呢?请问.

代码-VB编写自动填写网页程序的问题

问题描述 VB编写自动填写网页程序的问题 最近用VB写了一个自动提交网页的程序,遇到了些问题 对网页上的这一段代码 INPUT onclick=addRowToTable(); class=editBottomButton type=button value=增加 ,应该输入哪一个字段能让按钮点击的动作发生? 附部分原代码: Private Sub Command4_Click() Dim SheetID As Integer Dim firstRowID As Integer Dim Tota

鼠标滑过超链接自动点击代码

链接|鼠标 有的站点上的超链接,当鼠标移上去时就会自动点击,其实很简单就是调用了一个函数代码而已.下面就是实现效果所需代码:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>鼠标滑过超链接自动点击代码</title> <script language="JavaScr

如何用VB做一个跟鼠标移动有关的windows服务程序?

问题描述 如何用VB做一个跟鼠标移动有关的windows服务程序? 我想做一个只要鼠标移动就会发生的一个windows 服务程序,还有要可以在龙之谷中运行. 解决方案 1.鼠标Hook 2.timer定时获取鼠标坐标 3.如果游戏有保护你可能注入不了 解决方案二: windows服务运行在单独的user session中,每个session有自己的鼠标键盘消息,所以不能用windows服务.你应该在你的当前桌面会话中编写一个拦截程序. 这里有一个例子:http://z.download.csdn