vb编程 求鼠标左键自动单击的编程
新建个form1,form1的Load事件中,我要让鼠标左键自动单击form1的中间位置的这个点,加载后单击这一次就好,不用多次。假设form1是5000*5000的大小...
新建个form1,form1的Load事件中,我要让鼠标左键自动单击form1的中间位置的这个点,加载后单击这一次就好,不用多次。假设form1是5000*5000的大小。那么form1的load事件代码怎么写?
展开
1个回答
展开全部
先在公共声明部分声激者明:
Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long , ByVal dx As Long , ByVal dy As Long , ByVal cButtons As Long , ByVal dwExtraInfo As Long)
然后在form1的明世薯load事件中添加:
mouse_event (MOUSEEVENTF_LEFTDOWN ,2500,2500,0,0)
mouse_event(MOUSEEVENTF_LEFTUP,2500,2500,0,0)
试返念试这样行不行
Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long , ByVal dx As Long , ByVal dy As Long , ByVal cButtons As Long , ByVal dwExtraInfo As Long)
然后在form1的明世薯load事件中添加:
mouse_event (MOUSEEVENTF_LEFTDOWN ,2500,2500,0,0)
mouse_event(MOUSEEVENTF_LEFTUP,2500,2500,0,0)
试返念试这样行不行
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询