vb6.0 中mouse_event不管用,不知哪里问题?
ConstMOUSEEVENTF_LEFTDOWN=&H2ConstMOUSEEVENTF_LEFTUP=&H4ConstMOUSEEVENTF_MOVE=&H1Cons...
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE = &H8000
pmx = Screen.Width / Screen.TwipsPerPixelX
pmy = Screen.Height / Screen.TwipsPerPixelY
mouse_event MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE, sbx * 65535 / pmx, sby * 65535 / pmy, 0&, 0&
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE, 0, 0, 0&, 0&
sbx和sby是我用GetCursorPos 获取的鼠标坐标
pmx和pmy是获得的屏幕分辨率
好象是 移动鼠标不管用,但是如果把 MOUSEEVENTF_ABSOLUTE 去掉,鼠标就跑到屏幕右下角了。 展开
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE = &H8000
pmx = Screen.Width / Screen.TwipsPerPixelX
pmy = Screen.Height / Screen.TwipsPerPixelY
mouse_event MOUSEEVENTF_MOVE Or MOUSEEVENTF_ABSOLUTE, sbx * 65535 / pmx, sby * 65535 / pmy, 0&, 0&
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP Or MOUSEEVENTF_ABSOLUTE, 0, 0, 0&, 0&
sbx和sby是我用GetCursorPos 获取的鼠标坐标
pmx和pmy是获得的屏幕分辨率
好象是 移动鼠标不管用,但是如果把 MOUSEEVENTF_ABSOLUTE 去掉,鼠标就跑到屏幕右下角了。 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
1个回答
展开全部
函数声明了吗?
Private Declare Sub mouse_event Lib "user32" (ByValdwFlags As Long, ByVal dx As
Long, ByValdy As Long, ByValcButtons As Long, ByValdwExtraInfo As Long)
Private Declare Sub mouse_event Lib "user32" (ByValdwFlags As Long, ByVal dx As
Long, ByValdy As Long, ByValcButtons As Long, ByValdwExtraInfo As Long)
追问
申明了呀,否则也不会把 MOUSEEVENTF_ABSOLUTE 去掉,鼠标就跑到屏幕右下角了。暂时用SetCursorPos了,感觉这个简单还实用。
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询