Thread: reading editbox contents from a different program

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    5

    reading editbox contents from a different program

    I need to read the contents of an editbox (or possibly a richedit box) from another program, and I'm not at all sure how to do this. GetWindowText() works when called on editboxes from my own program, but it just returns an empty string when I've tried it on editboxes from other programs. Does anyone know how I could do this?

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Use SendMessageTimeout to send various edit control messages to the target control as discussed towards the end of this thread.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    5
    This is kind of a stupid question, but do you know what message I might use for this, or even better how I could get a list of the messages an edit box can accept?

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    The messages of interest are discussed in the thread I mentioned in my previous post (EM_GETLINE, EM_GETLINECOUNT, for example). You can get a comprehensive description of edit controls, their messages, etc. from this page on msdn.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Calling external program and reading its output.
    By Dragoon_42 in forum C++ Programming
    Replies: 3
    Last Post: 10-18-2007, 05:34 AM
  2. Replies: 20
    Last Post: 06-12-2005, 11:53 PM
  3. Getting the name of a file reading to program
    By DarkAbyss in forum C++ Programming
    Replies: 1
    Last Post: 03-22-2003, 10:14 AM
  4. Whats wrong with my file reading program?
    By Alphabird32 in forum C++ Programming
    Replies: 1
    Last Post: 09-08-2002, 03:19 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM