Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing character in the keyboard buffer

Status
Not open for further replies.

Kocky

Programmer
Joined
Oct 23, 2002
Messages
357
Location
NL
Hello,

Does anyone know how to put a character in the windows keyboard buffer ?
I believe I have to use a API function. I thought using PostMessage with message WM_CHAR.

Any idea's ?

Greetings,

Pascal.
 
if you want to send char to another application
The following code is used to insert a character into another application - Notepad.
~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.Button1Click(Sender: TObject) ;
var g,d:integer;
begin
{Find the main window of the Application}
g:=FindWindow('Notepad',nil) ;
{Find the window of the application's text box}
d:=ChildWindowFromPoint(g,point(50,50)) ;
{Now send it a character!!}
SendMessage(d,WM_CHAR,Ord('A'),0) ;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~

Aaron Taylor
John Mutch Electronics
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top