Board index » delphi » Simulating key presses

Simulating key presses

Hello.

  How can I simulate key presses in a TMemo?  For example I would
like to simulate <ctrl>+<home> or <end>.  

Hope someone can help

Ahmad

--
_________________________________________________________________________
| Ahmad Qazi                               Dept. Informatique et de     |
| [email protected]          ___       Recherche Operationnelle     |
|                               (@ @)       Universite de Montreal      |
-----------------------------ooO-(_)-Ooo---------------------------------

 

Re:Simulating key presses


The only way to simulate keypresses, is to use SendMessage()
with WM_KEYDOWN/WM_CHAR/WM_KEYUP messages (which is somewhat
involved).

If you just want to position the caret in the memo (which is
what the examples you cited do), you can do that with the
SelStart and SelLength properties.

--

Ahmad Qazi <[email protected]> wrote in article
<[email protected]>...

Quote
> Hello.

>   How can I simulate key presses in a TMemo?  For example I would
> like to simulate <ctrl>+<home> or <end>.  

> Hope someone can help

> Ahmad

> --
> _________________________________________________________________________
> | Ahmad Qazi                               Dept. Informatique et de     |
> | [email protected]          ___       Recherche Operationnelle     |
> |                               (@ @)       Universite de Montreal      |
> -----------------------------ooO-(_)-Ooo---------------------------------

Other Threads