VB 用SendMessage或PostMessage如何实现鼠标移动?

2024-11-19 12:25:24
推荐回答(1个)
回答1:

系统调用直接移动鼠标不是通过 WM_MOUSEMOVE
WM_MOUSEMOVE 是鼠标移动以后发出的

应该用
Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long

Dim x as Long
Dim y as Long

x = 0
y = 0
SetCursorPos x, y