作业帮 > 综合 > 作业

好心人帮我弄弄这个,看看这个程序哪里错了,怎么改吧~~~谢谢呀

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/04/29 07:15:52
好心人帮我弄弄这个,看看这个程序哪里错了,怎么改吧~~~谢谢呀
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Private Type POINTAPI
x As Long
y As Long
好心人帮我弄弄这个,看看这个程序哪里错了,怎么改吧~~~谢谢呀
在最后加一个end Type,如下
Private Type POINTAPI
x As Long
y As Long
End Type
调用坐标的方法如下:
Dim P1 As POINTAPI
GetCursorPos P1
Label1.Caption = CStr(P1.x) & "," & CStr(P1.y)