I’ve been developing a .net application for the company I work for, there is just one part I can’t seem to do. I need to send a string to a textbox of another program and then copy the result. The result is shown in a label. Currently we hand type the string and manually copy the label text, so I know the information can be copied I just don’t know how to do it via code.
The application I need to send the text too is also written with the .net framework if that helps.
Any answers are appreciated 🙂
Cheers.
You can use native SendMessage() from user32.dll. If you dont know how to import a dll command,
see Platform Invoke Tutorial from MSDN.
Once you know how to import a dll command, use FindWindow() to find the window handle of your application and send the string using SendMessage().
The other alternatives is to use socket. Send the message via local network (localhost).
Here’s a small tutorial about Socket. Hope this helps 🙂