Move the mouse! 
Author Message
 Move the mouse!

Is there any method to move the position of the mouse for VB?


Mon, 03 Jun 2002 03:00:00 GMT  
 Move the mouse!
Hi J.J.,

API function SetCursorPos:

Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y
As Long) As Long

Pete

www.compuguide.be/vbasic/


Quote:
> Is there any method to move the position of the mouse for VB?



Mon, 03 Jun 2002 03:00:00 GMT  
 Move the mouse!
Try something like,

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

SetCursorPos Scalewidth/2,scaleheight/2

Neil Gregory

* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Mon, 03 Jun 2002 03:00:00 GMT  
 Move the mouse!
Is there any method to move the position of the mouse for VB?


Mon, 03 Jun 2002 03:00:00 GMT  
 Move the mouse!
Hi J.J.,

API function SetCursorPos:

Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y
As Long) As Long

Pete

www.compuguide.be/vbasic/


Quote:
> Is there any method to move the position of the mouse for VB?



Mon, 03 Jun 2002 03:00:00 GMT  
 Move the mouse!
Try something like,

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

SetCursorPos Scalewidth/2,scaleheight/2

Neil Gregory

* Sent from AltaVista http://www.altavista.com Where you can also find
related
Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful



Mon, 03 Jun 2002 03:00:00 GMT  
 Move the mouse!
So, how to generate a 'Click' event?
Quote:

> Is there any method to move the position of the mouse for VB?



Tue, 04 Jun 2002 03:00:00 GMT  
 Move the mouse!
So, how to generate a 'Click' event?
Quote:

> Is there any method to move the position of the mouse for VB?



Tue, 04 Jun 2002 03:00:00 GMT  
 Move the mouse!

Simply, in your code, put:

Call Command1_Click()

or just:

Command1_Click()

and that will run the sub.

Quote:
> So, how to generate a 'Click' event?

> > Is there any method to move the position of the mouse for VB?



Wed, 05 Jun 2002 03:00:00 GMT  
 Move the mouse!

But I have to click objects outside the application, e.g. Start menu botton.
Command1_Click() method dosen't support.

  Simply, in your code, put:
  Call Command1_Click()

  or just:

  Command1_Click()

  and that will run the sub.

    So, how to generate a 'Click' event?
    >
    > Is there any method to move the position of the mouse for VB?
    >
    >
    >



Wed, 05 Jun 2002 03:00:00 GMT  
 Move the mouse!

This code should help a bit. Just whack it in a form, press the up key
and see what happens.

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long,
ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal
dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyUp Then
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 3, 3
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 3, 3
End If
End Sub

Quote:

> But I have to click objects outside the application, e.g. Start menu
> botton.Command1_Click() method dosen't support.



>      code, put:

>      Call Command1_Click()

>      or just:

>      Command1_Click()

>      and that will run the sub.

>     > So, how to generate a 'Click' event?

>     > > Is there any method to move the position of the mouse
>     > for VB?



Wed, 05 Jun 2002 03:00:00 GMT  
 Move the mouse!

--------------E2DBB5980DACC418C81CE5EA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Simply, in your code, put:

Call Command1_Click()

or just:

Command1_Click()

and that will run the sub.

Quote:
> So, how to generate a 'Click' event?

> > Is there any method to move the position of the mouse for VB?

--------------E2DBB5980DACC418C81CE5EA
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<i>Simply, in your code, put:</i>
<p>Call Command1_Click()
<p><i>or just:</i>
<p>Command1_Click()
<p><i>and that will run the sub.</i>
<blockquote TYPE=CITE>So, how to generate a 'Click' event?
<p>>
<br>> Is there any method to move the position of the mouse for VB?
<br>>
<br>>
<br>></blockquote>
</html>

--------------E2DBB5980DACC418C81CE5EA--



Wed, 05 Jun 2002 03:00:00 GMT  
 Move the mouse!

--------------2CA525C0A8AF6EF587FC5B36
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This code should help a bit. Just whack it in a form, press the up key and
see what happens.

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx
As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Const MOUSEEVENTF_LEFTDOWN = &H2 Private Const MOUSEEVENTF_LEFTUP =
&H4

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode =
vbKeyUp Then
    mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 3, 3
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 3, 3
End If
End Sub

Quote:

> But I have to click objects outside the application, e.g. Start menu
> botton.Command1_Click() method dosen't support.



>      code, put:

>      Call Command1_Click()

>      or just:

>      Command1_Click()

>      and that will run the sub.

>     > So, how to generate a 'Click' event?

>     > > Is there any method to move the position of the mouse
>     > for VB?

--------------2CA525C0A8AF6EF587FC5B36
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#FFFFFF">
This code should help a bit. Just whack it in a form, press the up key and
see what happens.
<p><font color="#3333FF">Private Declare Sub mouse_event Lib "user32" (ByVal
dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long,
ByVal dwExtraInfo As Long)</font>
<br><font color="#3333FF">Private Const MOUSEEVENTF_LEFTDOWN = &amp;H2</font>
<br><font color="#3333FF">Private Const MOUSEEVENTF_LEFTUP =
&amp;H4</font><font color="#3333FF"></font>
<p><font color="#3333FF">Private Sub Form_KeyDown(KeyCode As Integer, Shift
As Integer)</font>
<br><font color="#3333FF">If KeyCode = vbKeyUp Then</font>
<br><font color="#3333FF">&nbsp;&nbsp;&nbsp; mouse_event
MOUSEEVENTF_LEFTDOWN,
0, 0, 3, 3</font>
<br><font color="#3333FF">&nbsp;&nbsp;&nbsp; mouse_event MOUSEEVENTF_LEFTUP,
0, 0, 3, 3</font>
<br><font color="#3333FF">End If</font>
<br><font color="#3333FF">End Sub</font>
<blockquote TYPE=CITE><style></style>
<font size=-1>But I have to click
objects outside the application, e.g. Start menu botton.</font><font
size=-1>Command1_Click()
method dosen't support.</font>
<blockquote
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px;
PADDING-LEFT: 5px; PADDING-RIGHT: 0px">Robert Bowmaker &lt;<a




in your code, put:</i>
<p>Call Command1_Click()
<p><i>or just:</i>
<p>Command1_Click()
<p><i>and that will run the sub.</i>
<blockquote TYPE="CITE">So, how to generate a 'Click' event?
<p>>
<br>> Is there any method to move the position of the mouse for VB?
<br>>
<br>>
<br>></blockquote>
</blockquote>
</blockquote>

</body>
</html>

--------------2CA525C0A8AF6EF587FC5B36--



Wed, 05 Jun 2002 03:00:00 GMT  
 Move the mouse!
This is a multi-part message in MIME format.

------=_NextPart_000_0011_01BF4965.2EDEC860
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

But I have to click objects outside the application, e.g. Start menu =
botton.
Command1_Click() method dosen't support.


  Simply, in your code, put:=20
  Call Command1_Click()=20

  or just:=20

  Command1_Click()=20

  and that will run the sub.=20

    So, how to generate a 'Click' event?=20
    >=20
    > Is there any method to move the position of the mouse for VB?=20
    >=20
    >=20
    >

------=_NextPart_000_0011_01BF4965.2EDEC860
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>But I have to click objects outside the application, =
e.g.=20
Start menu botton.</FONT></DIV>
<DIV><FONT size=3D2>Command1_Click() method dosen't =
support.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: =
0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
  <DIV>Robert Bowmaker &lt;<A=20
  =

&gt;=20
  =

.nz</A>...</DIV><I>Simply,=20
  in your code, put:</I>=20
  <P>Call Command1_Click()=20
  <P><I>or just:</I>=20
  <P>Command1_Click()=20
  <P><I>and that will run the sub.</I>=20
  <BLOCKQUOTE TYPE=3D"CITE">So, how to generate a 'Click' event?=20
    <P>&gt; <BR>&gt; Is there any method to move the position of the =
mouse for=20
    VB? <BR>&gt; <BR>&gt; =
<BR>&gt;</P></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0011_01BF4965.2EDEC860--



Wed, 05 Jun 2002 03:00:00 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. move a mouse pointer to a different location without moving the mouse

2. Changing to a Copy or Move DragIcon while in Drag mode but NOT moving the mouse

3. Moving the mouse with DHTML

4. Moving the Mouse

5. Moving the mouse

6. Moving the mouse.

7. programmatically moving the mouse cursor

8. moving the mouse to another position!

9. Moving the mouse by command

10. Moving the mouse with VB5

11. Moving the mouse from within the program

12. Moving the mouse programatically ?

 

 
Powered by phpBB® Forum Software