GetCursorPos liefert immer 0
Ich will in VB2005 die Cursorposition abfragen.
Die Funktion GetCursorPos liefert immer 0, egal wohin ich die Maus bewege.
Die Deklaration:
Private Structure POINTAPI
Dim x As Int32
Dim y As Int32
End Structure
Private Declare Function GetCursorPos Lib "user32.dll" (ByVal lpPoint As POINTAPI) As Int32
Die Nutzung der Funktion:
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
Dim CP As POINTAPI
GetCursorPos(CP)
TextBox1.Text = CP.x
TextBox2.Text = CP.y
End Sub
für die Werte CP.x und CP.y bekomme ich immer 0.
Kann mir jemand helfen?
Die Funktion GetCursorPos liefert immer 0, egal wohin ich die Maus bewege.
Die Deklaration:
Private Structure POINTAPI
Dim x As Int32
Dim y As Int32
End Structure
Private Declare Function GetCursorPos Lib "user32.dll" (ByVal lpPoint As POINTAPI) As Int32
Die Nutzung der Funktion:
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
Dim CP As POINTAPI
GetCursorPos(CP)
TextBox1.Text = CP.x
TextBox2.Text = CP.y
End Sub
für die Werte CP.x und CP.y bekomme ich immer 0.
Kann mir jemand helfen?
Please also mark the comments that contributed to the solution of the article
Content-Key: 90523
Url: https://administrator.de/contentid/90523
Printed on: April 25, 2024 at 16:04 o'clock
2 Comments
Latest comment