Board index » delphi » How to sendkey to the active application ???

How to sendkey to the active application ???

Hi all,

I try to run an application and then send commands via keys. But I don't
know how to send keycodes to an application ?

Any help ?

Thanks in advance.

Jr?me Lyperre
E-Mail : jerome.lype...@cognos.com

 

Re:How to sendkey to the active application ???


Quote
Jr?me Lyperre wrote:

> Hi all,

> I try to run an application and then send commands via keys. But I don't
> know how to send keycodes to an application ?

> Any help ?

> Thanks in advance.

> Jr?me Lyperre
> E-Mail : jerome.lype...@cognos.com

Try this:

...
PostMessage(Application.Handle, WM_CHAR, ..., ...);
...

You'll find more info in Windows API help, looking for WM_CHAR message
and PostMessage function. You'll find a lot of useful hints ...

Live Long and Prosper ...

Gandalf

Re:How to sendkey to the active application ???


Quote
Jr?me Lyperre <jerome.lype...@cognos.com> wrote:
>Hi all,

>I try to run an application and then send commands via keys. But I don't
>know how to send keycodes to an application ?

There is a DLL (SendKey.Dll) in the Delphi FAQ section 2.5.24 that
will emulate the VB SendKey function.

- Mats
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Argue for your limitations                      Mats Andersson  
and you can be sure to keep them                Jakobstad
                Donald Shimoda                  FINLAND 967-7236 105

The Delphi FAQ is at http://proxy.sbrain.syh.fi/delphi/delphi_faq.html

Other Threads