Mouse Coords in a dill file that vb can reference to.

What I would like to really know how to do is the following. The go.dll would be able to supply the x,y coords needed for the MouseMove to work. Not sure if this would be the correct way, but thanks for the help. The following should work with Visual Studio 2010 / Visual Basic.

So the go.dll would be something like:
Class1

Dim moosex = (1000)
Dim moosey = (254)

End Class

Open in new window


Reference go.dll

MouseMoveTo(New Point(Val(moosex), Val(moosey)))

Open in new window

LVL 1
Jack_JonesAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
Yes if its VB.NET then use the Point class.
0
 
CodeCruiserCommented:
Make these public

Public moosex = (1000)
Public moosey = (254)
0
 
Jack_JonesAuthor Commented:
so it wouldn't need a .dll just need to have the varables in a Public setting?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
CodeCruiserCommented:
Yes you can put the variables in a module and these will be accessible in whole project.
0
 
Jack_JonesAuthor Commented:
Is this possible with that method, then I could have it just call 1 value, instead of doing 2 for each value.

Public moosemove As String = MoveMouseTo(New Point(Val(-1152), Val(358)))
0
 
CodeCruiserCommented:
I did not understand you question? You can declare a Point variable instead of two integers.
0
 
Jack_JonesAuthor Commented:
I have an autoit mindset sorry, but for example.

In autoit, I could pass a varable using an array to the mouse coord location.

Like:

Global Const $movehere[2] = [ 1020, 39 ]

This above would tell the following where to go.

MouseClick("left", $movehere[0], $movehere[1]

So I guess I am trying to accomplish this in Visual Basic.

0
 
CodeCruiserCommented:
In that case

Dim Points(2) As Integer
Points(0) = 1020
Points(1) = 39

http://msdn.microsoft.com/en-us/library/wak0wfyt.aspx

Its VB6 right?
0
 
Jack_JonesConnect With a Mentor Author Commented:
This is VB 2010, also I found the following might work. In theory right now it looks like it woulld put the code after the = of the Dim MoveHere, and plug in the values needed for the actual mousemove command. Thoughts?

Dim MoveHere = (New Point(Val(-1152), Val(368)))

AppActivate("Calc")

MoveMouseTo(MoveHere)

Open in new window

0
 
Jack_JonesAuthor Commented:
Thanks, system says it will close the question on 4/14/11 so you will see your points then I beleve.
0
 
CodeCruiserCommented:
Yeah no problem.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
You can call it like this:

    MoveMouseTo(New Point(1020, 39))

or this:

    Dim pt As New Point(1020, 39)
    MoveMouseTo(pt)
0
 
Jack_JonesAuthor Commented:
With my own trial and error, and CodeCruiser we were both able to finally get my mind in the right direction.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.