(VB)API 函数 GetCursorPos 的问题?
答案:4 悬赏:30 手机版
解决时间 2021-04-05 05:34
- 提问者网友:佞臣
- 2021-04-05 00:07
(VB)API 函数 GetCursorPos 的问题?
最佳答案
- 五星知识达人网友:野味小生
- 2021-04-05 00:34
自定义类型的变量在给api传递时必须传址,byval不行。
全部回答
- 1楼网友:撞了怀
- 2021-04-05 01:59
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_Click()
Dim a As POINTAPI
GetCursorPos a
Bt1.Text =a.x
End Sub
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_Click()
Dim a As POINTAPI
GetCursorPos a
Bt1.Text =a.x
End Sub
- 2楼网友:冷風如刀
- 2021-04-05 01:51
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Form1_Load()这个过程是你自已写的呢,还是默认的呢?
Form1_Load()这个过程是你自已写的呢,还是默认的呢?
- 3楼网友:往事埋风中
- 2021-04-05 01:09
Private Structure POINTAPI
Dim x As Integer
Dim y As Integer
End Structure
Private Declare Function GetCursorPos Lib "user32" (ByRef AP As POINTAPI) As Integer
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim a As POINTAPI
GetCursorPos(a)
Bt1.Text = a.x
End Sub
Dim x As Integer
Dim y As Integer
End Structure
Private Declare Function GetCursorPos Lib "user32" (ByRef AP As POINTAPI) As Integer
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim a As POINTAPI
GetCursorPos(a)
Bt1.Text = a.x
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯