Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Integer
y As Integer
End Type
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
End Sub
Private Sub Timer1_Timer()
Dim pos As POINTAPI
GetCursorPos pos
Label1.Caption = pos.x
Label2.Caption = pos.y
End Sub
为什么y坐标总为0,x是正确的~
谢谢~~~
Private Type POINTAPI
x As Integer
y As Integer
End Type
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
End Sub
Private Sub Timer1_Timer()
Dim pos As POINTAPI
GetCursorPos pos
Label1.Caption = pos.x
Label2.Caption = pos.y
End Sub
为什么y坐标总为0,x是正确的~
谢谢~~~
解决方案 »
- modules 和 class modules 里的代码 是否可以 被 作为一个整体 添加到新的工程里?
- 用VB怎样做一个自动升级的程序?
- GetGlyphOutline:如何用此API得到文字的阵列?
- ListView空间如何实现交替颜色的条目背景?
- 高分求教,如何在MDI主窗口中使用shell(或shellexecute)调用另外一个程序(也是自己写的)同时运行在主窗口中(类似MDI Child)?
- 在excel文件之间进行表单复制
- 为什么总是出错“3265”?在线等待,急。。。。。。。。
- 关于Microsoft Visual SourceSafe
- 急急急!脑袋都大了!该怎么办?
- 简单问题,代码理解!
- 怎样截取视频流,象摄像头附带的程序
- 浮点运算溢出怎样处理?
x As Long
y As Long
End Type