Re: RE: Is there someway to simulate mouse action(move and click) inkernel driver ?

> You have 2 options:

  1. if you have a user mode service or component already, have it
    simulate the input via SendInput()
  2. if you don’t have 1), you must enumerate a child/install a virtual
    mouse, install it under the mouse class, and behave like a true mouse
    port.

Option 1) is certainly way easier if it is available to you.

Option 1 though has some issues with multiple window-stations/desktops,
for example when using terminal-server or windows XP with multiple
concurrent user-sessions.
Plus the “allow service to interact with desktop” thingy has to be
checked for the service - but that usually shouldn’t be a problem.
(It only requires one to have the service run under the local-system
account, but again, that usually shouldn’t be a problem)

If one needs to send input to the “current” desktop (that one that
does recieve the input from a real mouse/keyboard), then the only
way I know would be a custom driver - option 2.

At least that were my findings after some reasearch on a similar topic
(in my case it was keyboard-input, but i think the same applies to mouse
input).

Regards,

Paul Groke

> > You have 2 options:

> 1) if you have a user mode service or component already, have it
> simulate the input via SendInput()
> 2) if you don’t have 1), you must enumerate a child/install a virtual
> mouse, install it under the mouse class, and behave like a true mouse
> port.
>
> Option 1) is certainly way easier if it is available to you.

Option 1 though has some issues with multiple window-stations/desktops,
for example when using terminal-server or windows XP with multiple
concurrent user-sessions.
Plus the “allow service to interact with desktop” thingy has to be
checked for the service - but that usually shouldn’t be a problem.
(It only requires one to have the service run under the local-system
account, but again, that usually shouldn’t be a problem)

If one needs to send input to the “current” desktop (that one that
does recieve the input from a real mouse/keyboard), then the only
way I know would be a custom driver - option 2.

At least that were my findings after some reasearch on a similar topic
(in my case it was keyboard-input, but i think the same applies to mouse
input).

Main problem is to identify a GUI object on the screen(location). Even
before sending input if some Popup’s comes, then problem arises. Getting
accurate Keyboard/Mouse replaying events is main problem. Once u know
location u can try to simulate Input either from UserMode or KernelMode.

Regards,
Satish K.S