Board index » delphi » Simulation of mouse/keyboard actions

Simulation of mouse/keyboard actions

I would like to simulate mouse/keyboard events from an Delphi
application, in order to run Windows applications, started with
ShellExecute.
 

Re:Simulation of mouse/keyboard actions


Quote
"Hans Hess" <hh...@t-online.de> wrote in message

news:c33df4a8.0206172337.3af62535@posting.google.com...

Quote
> I would like to simulate mouse/keyboard events from an Delphi
> application, in order to run Windows applications, started with
> ShellExecute.

You can send messages to the application using SendMessage. First you'll
need to find the handle of the window you want to send them too (see
FindWindow in help). Messages you'll be interested in are WM_KEYDOWN,
WM_KEYUP, WM_LBUTTONDOWN and the like.

Or, if most of the actions performed in the application are in menus or
buttons, you could use Resource Workshop to check out menu ID's for the
actions you want, and send a WM_COMMAND message with the correct ID.

Hope this helps
~David

Re:Simulation of mouse/keyboard actions


I am interested in this topic, too. Where do I find reference material on
this topic (Messages, handles, etc.)?

Greetings,
Michael Goerz

"David Bamber" <bambi...@hotmail.com> schrieb im Newsbeitrag
news:aen161$2s8$1@wisteria.csv.warwick.ac.uk...

Quote

> "Hans Hess" <hh...@t-online.de> wrote in message
> news:c33df4a8.0206172337.3af62535@posting.google.com...
> > I would like to simulate mouse/keyboard events from an Delphi
> > application, in order to run Windows applications, started with
> > ShellExecute.

> You can send messages to the application using SendMessage. First you'll
> need to find the handle of the window you want to send them too (see
> FindWindow in help). Messages you'll be interested in are WM_KEYDOWN,
> WM_KEYUP, WM_LBUTTONDOWN and the like.

> Or, if most of the actions performed in the application are in menus or
> buttons, you could use Resource Workshop to check out menu ID's for the
> actions you want, and send a WM_COMMAND message with the correct ID.

> Hope this helps
> ~David

Re:Simulation of mouse/keyboard actions


Or use the keybd_event function which basically does all this for you

Marc

Other Threads