Replicating Mouse Clicks

  • Thread starter Thread starter Terry Redmond
  • Start date Start date
T

Terry Redmond

Is there a way to perform a mouse click in C#, but without touching the
mouse....if you know what i mean?
 
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.
 
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>
 
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.
 
Back
Top