Board index » cppbuilder » How to push a char into the keyboard buffer...

How to push a char into the keyboard buffer...


2007-01-28 10:40:48 AM
cppbuilder108
All:
I have no code on this to refer to. Normally I would do this the
old school way using Int 21H function 09 - my goal is to have
notepad open and have my program running in the background
pushing chars into the buffer - and whatever text dialogue (such
as notepade) recieve them - WITHOUT having to meddle with the
API or the messaging services.
In essence - I want whatever program that I choose focused to
recieve input from a 'virtual' keyboard with text I choose to
insert.
Anyone have a clue/hint they can give?
Thank you.
 
 

Re:How to push a char into the keyboard buffer...

"Matthew" < XXXX@XXXXX.COM >wrote in message
Quote
In essence - I want whatever program that I choose focused to
recieve input from a 'virtual' keyboard with text I choose to
insert.
Look at keybd_event() in the Win32 API
Gambit
 

Re:How to push a char into the keyboard buffer...

Refer -
Quote
Look at keybd_event() in the Win32 API
I have the Win 32 programming guide By Rector and Newcomer -
It's a thick one - and there is no reference to that call.
At least not in the index...
Can you give a bit more info? Perhaps a link or example?
Thank you Gambit.
 

{smallsort}

Re:How to push a char into the keyboard buffer...

Quote
Can you give a bit more info? Perhaps a link or example?

google.com
 

Re:How to push a char into the keyboard buffer...

"Matthew" < XXXX@XXXXX.COM >wrote in message
Quote
I have the Win 32 programming guide By Rector and Newcomer -
It's a thick one - and there is no reference to that call.
At least not in the index...
Can you give a bit more info? Perhaps a link or example?
Have you tried looking in the Win32 API docs that ship with BCB?
Otherwise, look it up at MSDN:
keybd_event
msdn2.microsoft.com/en-us/library/ms646304.aspx
Gambit
 

Re:How to push a char into the keyboard buffer...

Quote
>Can you give a bit more info? Perhaps a link or example?
Sure thing... I have an application goes idle after 30 mins
of keyboard activity. The program is old and the source for
it is long gone. It is an old windows application. I need
code to emulate the effect of someone remaining at the
keyboard and perodically (every thirty minutes) hit a key
to keep the application from shutting down.
Thus, I need a way to place a keystroke on the keyboard buffer
which will the be immediately 'eaten' by the OS, and processed
by the application in question. I know for certain that this
is possible - I've done it a hundred years ago with Win 3.1
and DOS... And I am certain it is possible to do under XP.
So, I want the keystroke pushing program to run in the
background (systray etc)... and then leave the main application
focused and maximized...
Thank you.
 

Re:How to push a char into the keyboard buffer...

On Sun, 28 Jan 2007 20:48:32 +0100, Matthew < XXXX@XXXXX.COM >wrote:
Quote
Sure thing... I have an application goes idle after 30 mins
of keyboard activity. The program is old and the source for
it is long gone. It is an old windows application. I need
code to emulate the effect of someone remaining at the
keyboard and perodically (every thirty minutes) hit a key
to keep the application from shutting down.
Have you tried SendMessage() with WM_CHAR or maybe WM_KEYDOWN/WM_KEYUP?
You can get the window handle by FindWindow().
//michael
--
Using Opera's revolutionary e-mail client: www.opera.com/mail/