Solved

Is there anyway to input text from one program into the textbox of another and then retrieve the resulting output?

Posted on 2004-09-05
2
183 Views
Last Modified: 2010-04-23
I am looking for a way to input text from my program into the textbox of another. I want a way of inputing text in one of my programs, and then having that text input into a program such as Outlook, or possibly another program that I coded ?

Is there any way possible I can do that ?
0
Comment
Question by:jorgenoctem
2 Comments
 
LVL 4

Accepted Solution

by:
Javert93 earned 20 total points
ID: 12008894
The short answer to your question is that it is possible, but it is extremely difficult and error-prone. You can set the text in a textbox outside of your process by sending WM_SETTEXT messages to the target textbox. However, the difficult part is getting the window handle you need to send the message. You must first enumerate all of the top-level windows using the EnumWindows API to get a handle to the window that contains the text box. You must then use that handle in a call to the EnumChildWindows API until you locate the target text box (you will have to use the GetClassName API to detemine if it is a textbox). Once you have the handle, you can start sending message to the textbox, but be warned, if the target window contains more than one textbox, you will have to perform some trial-and-error to make sure you have a handle to the right one. Also, if the control layout changes between application versions, then you will need a seperate routine to get the textbox handle for each version of the application.
0
 

Author Comment

by:jorgenoctem
ID: 12022131
Thank you very much, that was very helpful.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question