您的位置:首页 > 编程语言 > VB

VB 6获取鼠标当前位置API

2005-11-10 09:55 323 查看
存档信息。

以前写一个控制自定义窗口缩放的控件的时候用过,今天用怎么也想不起来。找出源代码,原来如此:

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

Private Type PointAPI
X As Long
Y As Long
End Type

使用:

Dim ScreenPoint As PointAPI
GetCursorPos ScreenPoint

换算为Twips:

Screen.TwipsPerPixelX * ScreenPoint.X
Screen.TwipsPerPixelY * ScreenPoint.Y
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: