473,396 Members | 1,995 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,396 software developers and data experts.

Replicating Mouse Clicks

Is there a way to perform a mouse click in C#, but without touching the
mouse....if you know what i mean?
Nov 15 '05 #1
4 1979
Terry

Not sure if we know what you mean.

Do you mean post a Mouse click message to the Windows Message pump?

Do you mean call a Click event on a WinForm/WebForm?

Let use know "What" you are trying to accomplish and the group will try to
help.

--
Glen Jones MCSD

"Terry Redmond" <re***@ntlworld.com> wrote in message
news:Lt****************@newsfep3-gui.server.ntli.net...
Is there a way to perform a mouse click in C#, but without touching the
mouse....if you know what i mean?

Nov 15 '05 #2
i need a bit of code to make the computer think i have clicked the left
mouse button.
i.e

If <condition> then

<click left mouse button>
If this is possible is it possible to hold the left mouse button down?

ie

If <condition> then

Do <hold left mouse button down>

until <condition>

<release mouse button>
Nov 15 '05 #3
Terry,

Ok, You can send quite a few mouse event messages to windows. To see a list
lookup the following MSDN Platform SDK article "Mouse Input Messages".

I would suggest the WM_LBUTTONUP message since it is only recieved when a
the mouse button is let go on a control.

To send this message call the User32.dll api function PostMessage();

Hope this helps.

--
Glen Jones MCSD

"Terry Redmond" <re***@ntlworld.com> wrote in message
news:1%****************@newsfep3-gui.server.ntli.net...
i need a bit of code to make the computer think i have clicked the left
mouse button.
i.e

If <condition> then

<click left mouse button>
If this is possible is it possible to hold the left mouse button down?

ie

If <condition> then

Do <hold left mouse button down>

until <condition>

<release mouse button>

Nov 15 '05 #4
Cheers! You're a life saver!
Nov 15 '05 #5

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

Similar topics

5
by: John Champaign | last post by:
Hi all, I'm working on an educational applet for a child with special needs. He's got a bit of a trick to make my life more difficult... To interact with the applet he needs to click on...
3
by: mitsura | last post by:
Hi, I have included a small listing. The test program opens a panel and show a bitmap. What I want is to when the mouse is over the bitmap panel, I want to trap the left mouse click. The...
13
by: James Bond | last post by:
Hello. My 80+ year old father has recently decided to get his first computer. Due to his age (and I suspect lack of playing pong as a child like I did) he lacks the manual dexterity to use a mouse...
1
by: Al | last post by:
I need to write an application that couns *global* mouse clicks, i.e., mouse clicks on the entire windows screen and not this application itelf. I found something similar:...
2
by: kumar_subrahmanya | last post by:
Hi, I am facing problems in sending mouse clicks via SendInput API. Mouse clicks are being sent but at the X,Y co-ordinates. I am mapping my monitor to the (0,0,65535,65535) virtual monitor as...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
0
by: ludwig.frank | last post by:
Hi, I am attempting to detect mouse clicks from within curses, using "select" on sys.stdin. It is working great within an xterm under X, but not very well in a "real" linux console. When I click...
10
by: bern11 | last post by:
If Form1 opens Form2 modally, how do I capture clicks on Form1 when Form2 is open? I want to click on Form1 and read the mouse co-ordinates into Form2. Since Form2 is open modally, Form1...
2
by: ImageAnalyst | last post by:
Does anyone know how to get rid of excess mouse clicks? I have a button that does some code which takes some time to execute. As soon as the user clicks the button, I disable the button in the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.