?
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
?
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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 …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 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