473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Send mouse clic

Hello,
I cant find a way to send a "mouse clic" (right or left) to an application,
like SENDKEYS for the keyboard.
Thanks for any answer
May 27 '06 #1
4 6851

"Totoche" <ni**@niconnu.com> skrev i en meddelelse
news:e5**********@news.tiscali.fr...
Hello,
I cant find a way to send a "mouse clic" (right or left) to an
application, like SENDKEYS for the keyboard.
Thanks for any answer


Use the Form_MouseDown routine...like this

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
If Button = 1 Then MsgBox "left"
If Button = 2 Then MsgBox "right"
End Sub
May 27 '06 #2
Many thanks for your fast answer.
But... i can't do it working...( excuse me i am french and new programmer)
Could you be more explicit ??
What i did:

Sub Activatetest()
returnvalue = Shell(App.Path + "\test.exe", 1)
AppActivate returnvalue
SendKeys "{RIGHT}", True
SendKeys "{RIGHT}", True
test = Form_MouseDown (1,0,10,10)
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single,
Y As Single)
If Button = 1 Then MsgBox "left"
If Button = 2 Then MsgBox "right"
End Sub

The sendkeys are executed, but the mouse clic do not work (error at
execution time).
Many thanks for your help
"StoneWare" <He*******@NoSpam.Net> a écrit dans le message de news:
44***********************@dread11.news.tele.dk...

"Totoche" <ni**@niconnu.com> skrev i en meddelelse
news:e5**********@news.tiscali.fr...
Hello,
I cant find a way to send a "mouse clic" (right or left) to an
application, like SENDKEYS for the keyboard.
Thanks for any answer


Use the Form_MouseDown routine...like this

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If Button = 1 Then MsgBox "left"
If Button = 2 Then MsgBox "right"
End Sub

May 27 '06 #3
Totoche wrote:
Hello,
I cant find a way to send a "mouse clic" (right or left) to an
application, like SENDKEYS for the keyboard.


You're looking for the mouse_event API. It doesn't actually send mouse
events to a specific application, but rather to a location on screen. Take
a look at http://vb.mvps.org/samples/MouseEvent for a drop-in ready class to
help you get going.
--
May 30 '06 #4
Many thanks Karl.
Regards

"Karl E. Peterson" <ka**@mvps.org> a écrit dans le message de news:
e5**********@nntp.aioe.org...
Totoche wrote:
Hello,
I cant find a way to send a "mouse clic" (right or left) to an
application, like SENDKEYS for the keyboard.


You're looking for the mouse_event API. It doesn't actually send mouse
events to a specific application, but rather to a location on screen.
Take
a look at http://vb.mvps.org/samples/MouseEvent for a drop-in ready class
to
help you get going.
--

May 31 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: BadOmen | last post by:
I want my program to send a mouse click to the window at the current mouse position, how do I do that? Example: I have my mouse over a button in Word and then my program is sending the left...
6
by: harvie wang | last post by:
Hi, How to send a message to every window(include child window), I use SendMessage ,but It can't do that. class frmA { public const int WM_test = 0x400 + 1; protected override void...
0
by: chenedor | last post by:
hi all i just started a new C++ .net form I ve put a basic usercontrol in it. the problem is that I want to use the clic event in my form to do several things but if i clic on the custom...
1
by: Miguel Dias Moura | last post by:
Hello, Can you help me out in making this work? What I want is as simple as sending form values to an email. The code I am using is the following:
7
by: scottiedog | last post by:
Hi How can I send a char to Textbox so that KeyPress event is called? I have a button and with a click I would like to send a char, e.g. "C", to the Textbox. But Textbox1_KeyPress is not catching...
0
by: neonspark | last post by:
I'm buidling some simple macro functionality for my app so the users can record a sequence of keyboard inputs and replay them reliably via some menu. Originally, I used: protected override bool...
0
by: Ralstoj | last post by:
Hi I am programing in Autocad with VB Autodesk have not given users access to new note function in Autocad CIVIL3d API. I am trying to work round this by creating notes using the sendkey...
2
by: wpollans | last post by:
Hello, I need to able to write JS that will click on a link with the middle mouse button - so that the link target will open in a new window or tab - using firefox. Or is there a better (more...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.