鼠标坐标
一般都是整数,没有小数。
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Dim p As POINTAPI
Private Sub Form_Load()
Timer1.Interval = 10
End Sub
Private Sub Timer1_Timer()
GetCursorPos p
Text1.Text = p.x
Text2.Text = p.y
End Sub
及时 你加上 Round(p.y, "0000.0000"),得到的结果都是整数!!
实现这个功能没有什么意思。