Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
198 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 80 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Integration Management Part 2
Loops Section Overview
Suggested Courses

972 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