Results 1 to 4 of 4

Thread: Accessing other programs

  1. #1

    Thread Starter
    New Member gorcq's Avatar
    Join Date
    Sep 2005
    Posts
    15

    Accessing other programs

    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.
    Last edited by gorcq; Sep 13th, 2005 at 10:26 PM.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Australia
    Posts
    243

    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
    Scott
    **********
    Visit my web page at www.hyphenex.ugtech.net

  3. #3

    Thread Starter
    New Member gorcq's Avatar
    Join Date
    Sep 2005
    Posts
    15

    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
    Last edited by gorcq; Sep 14th, 2005 at 03:30 PM.

  4. #4
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width