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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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