Help - Search - Members - Calendar
Full Version: Visual Basic Mouse manipulation
Pixel2Life Forum > Help Section > Desktop Programming
Nightscream
How can I manipulate the mouse?
Eumh let the mouse click on a coordinate. I know you can but just don't know the command..
U1
Have you tried SetCursorPos and Mouse_Event API's?
Nightscream
nope going to try this smile.gif
Nightscream
ok I found the way to manipulate it but now I got another problem
I'm using the GetCursorPos function
But when i want to see the x and y coords i get something very strange.
x = 1155346203274
y = 0
Now i want to know how can i get this fixed? :s

CODE
Structure PointApi
    Dim x As Long
    Dim y As Long
End Structure

Declare Function GetCursorPos Lib "User32" ( _
        ByRef lpPoint As PointApi) As Long

Private Sub btnPosition_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPosition.Click
Dim pt32 As PointApi

GetCursorPos(pt32)

txtX.Text = pt32.x
txtY.Text = pt32.y
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.