마우스 죄표값 얻기

V닉맨 2014.05.27 09:24:22 *: Public Structure POINTAPI
Dim x As Integer
Dim y As Integer
End Structure
Public Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Integer


Dim p As POINTAPI
GetCursorPos(p)
TextBox1.Text = "X값 : " & p.x & " / Y값 : " & p.y

* 선언

Public Structure POINTAPI

        Dim x As Integer

        Dim y As Integer

    End Structure


Public Declare Function GetCursorPos Lib "user32.dll" (ByRef lpPoint As POINTAPI) As Integer


*사용

Dim p As POINTAPI

        GetCursorPos(p)

        TextBox1.Text = "X값 : " & p.x & "  / Y값 : " & p.y