欢迎来到天天文库
浏览记录
ID:37912525
大小:33.00 KB
页数:4页
时间:2019-06-02
《DJ(豆俊)鼠标点击程序源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、说明:本文件的一些内容是之前学习的时候在网上找的模板1:‘首先对API函数进行声明PublicDeclareFunctionSetCursorPosLib"user32"(ByValxAsLong,ByValyAsLong)AsLong‘设置鼠标所在位置PublicDeclareFunctionGetCursorPosLib"user32"(lpPointAsPOINTAPI)AsLong‘获取鼠标坐标DeclareSubmouse_eventLib"user32"Alias"mouse_event"(ByValdwFlagsAsLong,ByValdxAsLong,By
2、ValdyAsLong,ByValcButtonsAsLong,ByValdwExtraInfoAsLong)’定义鼠标事件DeclareSubSleepLib"kernel32"(ByValdwMillisecondsAsLong)制作子过程:PublicsubShuBiao(byvalxasinteger)Ifx=1thenmouse_eventMOUSEEVENTF_LEFTDOWNOrMOUSEEVENTF_LEFTUP,0,0,0,0elsemouse_eventMOUSEEVENTF_LEFTDOWNOrMOUSEEVENTF_LEFTUP,0,0,0,0mo
3、use_eventMOUSEEVENTF_LEFTDOWNOrMOUSEEVENTF_LEFTUP,0,0,0,0endifEndsub模板2:‘定义变量PublicconstMOUSEEVENTF_MOVE=&H1’移动鼠标PublicconstMOUSEEVENTF_LEFTDOWN=&H2’模拟鼠标左键按下PublicconstMOUSEEVENTF_LEFTUP=&H4’模拟鼠标左键抬起PublicconstMOUSEEVENTF_RIGHTDOWN=&H8’模拟鼠标右键按下PublicconstMOUSEEVENTF_RIGHTUP=&H10’模拟鼠标右键抬起P
4、ublicTypePOINTAPIxAsLongyAsLongEndTypePublicPaspointapiPublica()assinglePublicb()assinglePublicstrasstringPublicxz()asinteger窗体:Timer控件:CallGetcursorpos(p)Label1=p.xLabel2=p.y“添加“按钮:Staticiaslongi=i+1redimpreservea(i)redimpreserveb(i)redimpreservexz(i)a(i)=text1b(i)=text2selectcasetruecas
5、eoption1.valuestr=”左键单击”xz(i)=1caseoption2.valuestr=”右键单击”xz(i)=2selectendtext3=text3&“在”&a(i)&b(i)&“处”&str“执行”按钮单击事件:DimsaslongFors=1toiSetCursorPos(a(s),b(s))Sleep500Shubiao(xz(s))Nexts
此文档下载收益归作者所有