Thread: Pressing a button in another app

  1. #1
    Unregistered
    Guest

    Question Pressing a button in another app

    I have a program that I have written in MFC++ and I want to add some aditional features.

    I want to be able to take actions on another program (that I did not write) based on calculations in my program.

    I do not know (at all) how to access the other running app. I can get the Process ID from the windows task manager, but I don't know what to do with that information once I have it. Also, there is text in the other application that I would like to be able to read. This text provides information for the calculations in my app.

    Can anyone point me to the starting place. Are there any MFCs that deal with this? How do I attach to the other application and interact with it? Again, I'm just looking for where to begin, I can figure it out if I can get a starting place.

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    223
    usually you can write to and read from windows in other programs buy you cannot necessary modify their behavior from your program...

    You would first have to get a handle to the window using

    FindWindow or FindWindowEx

    and then sending messages to that window...
    zMan

  3. #3
    Unregistered
    Guest

    Thumbs up Great!

    Thank you so much. That was easier than I was expecting. I will have to play around with it to get everything that I need, but I just ran a test and was able to send a WM_CLOSE to a window and watch it close. Very cool. Thanks again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. screen color detection and button pressing
    By cwn11 in forum C Programming
    Replies: 1
    Last Post: 11-23-2008, 10:39 PM
  2. Virtually pressing a button
    By Queatrix in forum Windows Programming
    Replies: 4
    Last Post: 08-19-2005, 10:19 AM
  3. Pressing a button works sometimes
    By johny145 in forum Windows Programming
    Replies: 14
    Last Post: 05-18-2005, 11:53 AM
  4. Pressing A Button on Dos..
    By yakabod in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 01-30-2003, 07:46 AM
  5. HowTo disable button in MFC app
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 01-04-2002, 02:15 AM