Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to simulate keyboard keys ?

288 views
Skip to first unread message

novainf...@ibm.net

unread,
Jan 29, 1998, 3:00:00 AM1/29/98
to

Hi everybody,

Does anybody know how can I send a key press to the buffer ?

Anything like VB command 'Keyboard' ...

Thank you very much...


Encap Support Software

unread,
Jan 29, 1998, 3:00:00 AM1/29/98
to

>
>Does anybody know how can I send a key press to the buffer ?
>
the following would send simulate a CTRL HOME key while the a memo component
has focus. The postmessage command would also work.

sendmessage(memo1.handle, wm_keydown, 17,0);
sendmessage(memo1.handle,wm_keydown,36,0);
sendmessage(memo1.handle,wm_keyup,36,0);
sendmessage(memo1.handle, wm_keyup,17,0);

Hope this helps

Encap Support Software
__________________________________________
Our Advertisement:
Need support to provide user support for the Microsoft IntelliMouse™
pointing device (a mouse with a Wheel). Check out our web site at
http://www.pacificocean.com/encap and download a demonstration version of
TMouseWheel, a component that provides complete support for the
IntelliMouse. You can also download for free, an "expert" that "wheel
enables" Delphi 2 and Delphi 3 (provides Internet Explorer style wheel
navigation abilities).


James D. Rofkar

unread,
Feb 3, 1998, 3:00:00 AM2/3/98
to

Or, bypass Windows message queue by using Delphi's Perform()
method. Like so...

Memo1.Perform(WM_KEYDOWN, VK_CONTROL, 0);
Memo1.Perform(WM_KEYDOWN, VK_HOME, 0);
Memo1.Perform(WM_KEYUP, VK_CONTROL, 0);
Memo1.Perform(WM_KEYUP, VK_HOME, 0);

Enjoy,
-Jim Rofkar.

Encap Support Software <encaps...@yahoo.com> wrote in article
<6aqv0v$hqe$1...@uuneo.neosoft.com>...

0 new messages