CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2005
    Posts
    3

    A program to control another program?

    I'm a little familiar with programming and I was wondering if anyone could send me in the right direction with the following problem:

    I'd like to write a program that takes on screen output from one program and use that output to control another program (like mouseclicks, etc.). Do I need to take screenshots and make comparisons of images? If so this does not seem like the most efficient way to do this. Any help is much appreciated. Also, how would I go about doing something like this?

    Thanks.

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: A program to control another program?

    I'm sorry, but I don't understand what you want. Can you explain a little more clear what are you trying to do?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Dec 1999
    Location
    North Sydney, NS
    Posts
    445

    Re: A program to control another program?

    Quote Originally Posted by programmer101
    I'm a little familiar with programming and I was wondering if anyone could send me in the right direction with the following problem:

    I'd like to write a program that takes on screen output from one program and use that output to control another program (like mouseclicks, etc.). Do I need to take screenshots and make comparisons of images? If so this does not seem like the most efficient way to do this. Any help is much appreciated. Also, how would I go about doing something like this?

    Thanks.

    You want one program to be controlled by the display output of another program? Are there 2 or 3 programs involved here? This sounds very confusing.

    If you're writing all the programs involved, there are many ways to handle interprocess communication like COM (Automation, connection points), sockets, pipes, and windows messages.
    I know how to build. What to build is a completely different story.

  4. #4
    Join Date
    Aug 2005
    Posts
    3

    Re: A program to control another program?

    I'm sorry if my first post was a little confusing. Let me try to clarify:

    I have two programs that I did not write. I want to write a third program that takes the on screen messages (output) of one program to press buttons in the second program. I don't need to do complex program manipulation; just button clicking.

    Thank you very much for your help.

  5. #5
    Join Date
    Feb 2005
    Posts
    106

    Re: A program to control another program?

    Greetings.

    If by "on screen messages" you mean text that is being drawn to the window of the first app, then hooking GDI will give you direct access to this text.

    To accomplish "pushing buttons" (it is unclear if you mean buttons attached to the window or "buttons" as in mouse/keyboard keys or both) you can parse the text being drawn in the first application and send messages to the window of the second application as appropriate.

    A reply with a little more clarity on your requirements would be helpful.

    Regards.

  6. #6
    Join Date
    Aug 2005
    Posts
    3

    Re: A program to control another program?

    Hi CodeMonkey,

    Thanks for taking the time to investigate my problem.

    The On-screen output is text, nothing too fancy, and I would like it to push buttons on the second program (not physical buttons like a mouse or keyboard - by sending commands to the second program). Control of the mouse would be one way to do this I assume but that doesn't seem like the best way to do it.

    Thanks.

  7. #7
    Join Date
    Feb 2005
    Posts
    106

    Re: A program to control another program?

    Hello again.

    Have you ran dumpbin against the first program to look at its import table? This will go a long way in moving you to where you want to be. I suppose I should have asked if the first program's output is to a console. If you can give just a little more detail on the format/layout of the output of this program it would be helpful.

    The second half of your requirements can be met by standard window messages.

    Regards.

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

Featured