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.
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;
~~~~~~~~~~~~~~~~~~~~~~~~~
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.