好心人帮我弄弄这个,看看这个程序哪里错了,怎么改吧~~~谢谢呀
问题描述:
好心人帮我弄弄这个,看看这个程序哪里错了,怎么改吧~~~谢谢呀
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)