Re: Accessing other programs
Quote:
Originally Posted by gorcq
I am trying to write a program that will automatically enter text into a textbox and then click on a button. The problem is that both the textbox and the button are on a separate form in an unrelated program, which will be running at the same time as my program. I do not have access to the second program's code, so I cannot integrate it into my project or solution.
Is there any way I can do this?
Thank you, Robby
Edit: The second program is made so that pressing the Enter key while focused on the textbox is equivalent to clicking on the button. I don't know whether or not this is useful information.
SendKeys can send keystrokes to an app. (Note, you can make Macro software to monitor the mouse strokes and possitions then replay, I made a RuneScape in the old days of Runescape in VB6.) I assume you could still do the same in .NET
Re: Accessing other programs
Thank you. That is exactly what I was looking for. However, I cannot seem to make it select the right textbox on the other form. Is there any way to do that?
Robby
Re: Accessing other programs
You might have more luck posting this in the API section. There are API calls you can use to send text to a textbox using SendMessage API's. Theres also ways of enumerating the windows using EnumWins, FindWindowEX, etc. in order to find the control you need to send to.