GetCursorPos Lib "user32" 是API函数?

pallon 2004-09-15 10:05:07
Public Declare Function GetCursorPos Lib "user32" (LPPoint As POINTAPI) As Long
运行程序时停在这行代码上,是什么问题?开发是在98下开发的代码,现在在2000中打开就停在这行上,应该怎么解决?谢谢
...全文
342 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
pallon 2004-09-16
  • 打赏
  • 举报
回复
to BlueBeer(1win) :
我在98上运行没提示错误,在XP下就不行,是不是这个是98下的API函数?如果我要改在2000或XP下可以运行该怎么搞呢?
BlueBeer 2004-09-15
  • 打赏
  • 举报
回复
【函数】
GetCursorPos

【操作系统】
Win9X:Yes
WinNT:Yes

【声明】
GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long

【说明】

获取鼠标指针的当前位置

【返回值】

Long,非零表示成功,零表示失败。会设置GetLastError

【其它】


【参数表】
lpPoint -------- POINTAPI,随同指针在屏幕像素坐标中的位置载入的一个结构
helanshan 2004-09-15
  • 打赏
  • 举报
回复
函数没有问题,出错提示是什么啊。。。
online 2004-09-15
  • 打赏
  • 举报
回复
Option Explicit

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Type POINTAPI
X As Long
Y As Long
End Type


Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Rec As RECT, Point As POINTAPI

GetCursorPos Point
Debug.Print Point.X
Debug.Print Point.Y
End Sub
online 2004-09-15
  • 打赏
  • 举报
回复
Private Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Long

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧