ZaSz
asked on
Sending key to another app (like writing to notepad)
For example, write something to notepad.
I have no idea how to do it.
Please no dll thing, only a procedure like WriteNotepad(Sentence: String) or something like that.
Thanks
I have no idea how to do it.
Please no dll thing, only a procedure like WriteNotepad(Sentence: String) or something like that.
Thanks
ASKER
With the FindWindow, what do I have to put in it to find Notepad?
And why do you search 2 windows?
And why do you search 2 windows?
i think this work in not operational, because the notepad not a socket exe file.
you can create a file and then open it with notepad
example create readme.txt in c:\test directory
and write this instruction for open this file:
ShellExecute(Handle, 'open', PChar('notepad'), PChar('c:\test\readme.txt' ), nil, SW_SHOW);
example create readme.txt in c:\test directory
and write this instruction for open this file:
ShellExecute(Handle, 'open', PChar('notepad'), PChar('c:\test\readme.txt'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
procedure TForm1.Send(S:String);
var
IM,IM2:Integer;
begin
IM:=FindWindow('IMClass',n
IM2:=findwindowex(IM, 0, PChar(lowercase('RICHEDIT'
Sendmessage(IM2,wm_Settext
SendMessage(IM2,wm_keydown
end;