Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP ME GUYS!

1 view
Skip to first unread message

Al-Asadi

unread,
Apr 11, 2000, 3:00:00 AM4/11/00
to
Hi guys!
I want a way to move the mouse pointer constantly with code .
Thanks.


Martijn

unread,
Apr 12, 2000, 3:00:00 AM4/12/00
to
Use the api-viewer (included with vb), and open the database.
Then browse to the setcursorpos function, and copy its declaration to the
clipboard. Then paste it in the declaration section of your program.
Now you can set the cursor to any position (example: if you want it at the
position 25,30 use setcursorpos(25,30) the cursor wil go to the position
you chose).

If you want to know where the cursor is positioned, do the following:
Open the api-viewer and open the database, then go to the getcursorpos
declaration, and copy it in to your code. You also need the pointapi type,
so go to the pointapi declaration and copy it in to your code.
Also declare a variable as pointapi (example: public declare pntPoint as
pointapi).
You can now read the cursorposition by using the getcursorpos command
(example: pntPoint = getcursorpos() pntpoint.x is the x position of the
cursor, and pntoint.y is the y position of the cursor).

--
Posted via CNET Help.com
http://www.help.com/

Al-Asadi

unread,
Apr 12, 2000, 3:00:00 AM4/12/00
to
I have a vb project , not an access database!

Martijn <martijn...@hotmail.com> wrote in message
news:sf89fv...@corp.supernews.com...

Mike Seddon

unread,
Apr 12, 2000, 3:00:00 AM4/12/00
to
In a separate module declare the following call

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

in your code you can then call the function using the syntax:

setcursorpos x,y

you can get a list of all winAPI functions by searching for the file
win32api.txt

Hope this helps

Mike.


Al-Asadi wrote in message ...

lask...@cix.compulink.co.uk

unread,
Apr 12, 2000, 3:00:00 AM4/12/00
to
In article <eXosxVHp$GA....@cppssbbsa02.microsoft.com>,
al-a...@intracom.net.lb (Al-Asadi) wrote:

> I have a vb project , not an access database!

He meant use the API-viewer to view the database of API calls. It's
nothing to do with access, it just the way the api viewer holds the
information about the various API calls.

Al-Asadi

unread,
Apr 15, 2000, 3:00:00 AM4/15/00
to
Thanks , it sure helped.
But I'm trying to make the cursor go round and round in circles infinitely ,
do you have away?


Mike Seddon <M_SE...@alliedbakeries.co.uk> wrote in message
news:8d1rle$utf$1...@newsreaderg1.core.theplanet.net...


> In a separate module declare the following call
>
> Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x
As
> Long, ByVal y As Long) As Long
>
> in your code you can then call the function using the syntax:
>
> setcursorpos x,y
>
> you can get a list of all winAPI functions by searching for the file
> win32api.txt
>
> Hope this helps
>
> Mike.
>
>
> Al-Asadi wrote in message ...

> >I have a vb project , not an access database!
> >

> >Martijn <martijn...@hotmail.com> wrote in message
> >news:sf89fv...@corp.supernews.com...
> >> Use the api-viewer (included with vb), and open the database.

Mike Seddon

unread,
Apr 17, 2000, 3:00:00 AM4/17/00
to
Hmm, good one, You should look at using the circle method to do this

Sub Form_Click ()
Dim CX, CY, Radius, Limit ' Declare variable.
ScaleMode = 3 ' Set scale to pixels.
CX = ScaleWidth / 2 ' Set X position.
CY = ScaleHeight / 2 ' Set Y position.
If CX > CY Then Limit = CY Else Limit = CX
For Radius = 0 To Limit ' Set radius.
Circle (CX, CY), Radius,RGB(Rnd * 255, Rnd * 255, Rnd * 255)
Next Radius

This is the example in Msdn, I'm sure if you thought about it for a while
you could come up with a method for plotting the x,y co-ords of the
circle to use with setcursorpos.
Hope this is of some help,
I'll have a think about it anyway if I get time today,
if I come up with something I'll mail the newsgroup.
Maybe someone else knows the formula for plotting a circle?

Mike Seddon

unread,
Apr 17, 2000, 3:00:00 AM4/17/00
to
see
http://WWW.math.sunysb.edu/~scott/mat331.fall97/samples/plotting/circle4.txt
and good luck because it gets heavy quick
Mike.


Mike Seddon wrote in message
<8der14$6eq$1...@newsreaderg1.core.theplanet.net>...

0 new messages