Need help with a visual basic command

Started by
3 comments, last by iscream3 16 years, 10 months ago
I have just recently started to make scripts in visual basic 2005 and have been stuck on a problem for the past 2 days. I am wondering if there is a command or script that allows the mouse to move automatically for you. I have also seen other scripts that move the mouse automatically using cordinates. Is it possible to use cordinates in VB and also how do you find out what the coordinates are? If you could post or tell me the command that would be awsome. Thanks for all your help!
Advertisement
You could try integrating the win32 commands into your source, like this:

Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long

Declare Function SetCursorPos Lib "user32" _
(ByVal x As Long, ByVal y As Long) As Long


... and just use those as you see fit.

I know this works for VB6, haven't done it with VB 2005.
It's not what you're taught, it's what you learn.
ok thanks ill try that but do you know how to get the cords of the cursor?
He told you how to get the mouse cursor position. However, using the WinAPI functions directly is a little unnecessary. Just use .NET's System.Windows.Forms.Cursor.Position to get or set the position of the mouse cursor.
[TheUnbeliever]
Thanks alot I think that solved my problem.

This topic is closed to new replies.

Advertisement