SetWindowText of Edit Box in another program's window

Posted on 2009-12-17
Last Modified: 2012-05-08
I'm making a basic program to input text into another program's Edit Box controls.  I am baffled why this simple thing is failing.  I have absolutely no problem getting the window handle and control ID for these controls but for some reason neither SetWindowText nor SetDlgItemText will work as far as entering text into the Edit Box controls of another program.  Thanks in advance.
Question by:Timbilt
    LVL 17

    Accepted Solution

    Activate that textbox and try SendKeys:
    LVL 9

    Assisted Solution

    Have you tried using the WM_SETTEXT message?  According to the documentation for SetWindowText:

    To set the text of a control in another process, send the WM_SETTEXT message directly instead of calling SetWindowText.

    Author Closing Comment

    This is exactly the answer I was looking for!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
    Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now