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
155 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now