Results 1 to 3 of 3

Thread: Pointapi ?[Resolved]

Threaded View

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Pointapi ?[Resolved]

    Why this won't work in .NET but work in VB6 with little difference(POINTAPI as Type not Structure)?
    VB Code:
    1. Private Structure POINTAPI
    2.         Dim X As Long
    3.         Dim Y As Long
    4.     End Structure
    5.     Dim mousepos As POINTAPI
    6.  
    7.     Private Declare Function GetCursorPos Lib "user32" (ByVal lpPoint As POINTAPI) As Long

    Usage :

    VB Code:
    1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    2.         GetCursorPos(mousepos)   ' Get Co-ordinets
    3.         Label1.Text = "x: " & mousepos.X  ' Get x co-ordinates
    4.         Label2.Text = "y: " & mousepos.Y ' Get y co-ordinates
    5.     End Sub
    Last edited by Pirate; May 12th, 2003 at 11:05 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width