From: JackWetson on
Hey Guys,

I'm looking to create a virtual mouse and keyboard that can be used to
control an application that is not in the foreground. If possible I
would like to control these virtual devices in C#, but im guessing
they need to be written in c++?

I am by no means asking to be spoon fed the answers but im rather
stuck on how I should go about it and would welcome any suggestions
and tips.
From: Christian ASTOR on
On 22 sep, 12:29, JackWetson <jack_wet...(a)hotmail.co.uk> wrote:

> I'm looking to create a virtual mouse and keyboard that can be used to
> control an application that is not in the foreground.

To control an application which is not in foreground,
use AttachThreadInput() - SetFocus() - SendInput()
From: JackWetson on
On Sep 22, 1:07 pm, Christian ASTOR <casto...(a)club-internet.fr> wrote:
> On 22 sep, 12:29, JackWetson <jack_wet...(a)hotmail.co.uk> wrote:
>
> > I'm looking to create a virtual mouse and keyboard that can be used to
> > control an application that is not in the foreground.
>
> To control an application which is not in foreground,
> use AttachThreadInput() - SetFocus() - SendInput()

But I dont want to set focus, I want it to stay in the background, it
should be able to be controlled simultaneously to the actual mouse and
keyboard
From: Christian ASTOR on
On 23 sep, 10:11, JackWetson <jack_wet...(a)hotmail.co.uk> wrote:

> > To control an application which is not in foreground,
> > use AttachThreadInput() - SetFocus() - SendInput()
>
> But I dont want to set focus, I want it to stay in the background, it
> should be able to be controlled simultaneously to the actual mouse and keyboard

You must set the focus for SendInput() (you can remove it afterwards),
or, without focus, you can send messages like WM_CHAR for Edit
controls for example, but it depends on the control class...