Link to home
Start Free TrialLog in
Avatar of hidrau
hidrauFlag for Brazil

asked on

send string to another windows application

Hello guys,

Is there any way to send a string to another application and in this application simulate enter?

Imagine that I have a string in a edit and I want to send this string to my notepad, each time I

press my buttom it send to my notepad the text and a enter code


This is possible?

alex
Avatar of MerijnB
MerijnB
Flag of Netherlands image

yes you can, see this unit: http://megalib.com/books/51/sndkey32.htm
Avatar of hidrau

ASKER

have you already worked with this unit?

there is an error in this line:

line 259  While (Ido begin

sorry, I thought it was the same as I'm using, apperantly not. Download mine here: http://www.xs4all.nl/~bosma/SendKeys.pas

please leave a message when you have it, so I can remove it again.
Avatar of hidrau

ASKER

ok, how does it work?
ASKER CERTIFIED SOLUTION
Avatar of MerijnB
MerijnB
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hidrau

ASKER

I have a notepad opened and I put your code in a button, but nothing was sent :((
Avatar of hidrau

ASKER

ok, I understood. I need to pass the name of my windows-

if the name saved is 'test', so it must be 'test' and not notepad.

is there a way to pass only the name of program?

I want to send a text to a babylon dictionary, I don't know if you know it.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TName
TName

>I need to pass the name of my windows
No, the window title. Or at least a fragment of it.
e.g. 'Editor' for Notepad. Just have a look at the title bar...
Avatar of hidrau

ASKER

ok,

it is working. :)))

but I have another question, I will open a new thread.

Thanks
Hi,

you answer:

>I need to pass the name of my windows
No, the window title. Or at least a fragment of it.

but your question is

Titel:  send string to another windows application
... to send a string to another application and in this application simulate enter?
Imagine that I have a string in a edit and I want to send this string to my notepad, each time I
press my buttom it send to my notepad the text and a enter code

Maybe I misunderstand but I don't see where your wrote in your question you wanted to pass the name of your windows ....


Sorry.
Hi,

Thanks for the points.

Now I see where you're talking of .... passing the name of your windows .... Didn't have received this subject before psoting my answer.


 
Hi bernani,
Look at hidrau's comment just above your first comment.
My answer was aimed at this.