Why this won't work in .NET but work in VB6 with little difference(POINTAPI as Type not Structure)?
VB Code:
Private Structure POINTAPI Dim X As Long Dim Y As Long End Structure Dim mousepos As POINTAPI Private Declare Function GetCursorPos Lib "user32" (ByVal lpPoint As POINTAPI) As Long
Usage :
VB Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick GetCursorPos(mousepos) ' Get Co-ordinets Label1.Text = "x: " & mousepos.X ' Get x co-ordinates Label2.Text = "y: " & mousepos.Y ' Get y co-ordinates End Sub





Reply With Quote