[Webinar] Learn how to a build a cloud-first strategyRegister Now


SetWindowText of Edit Box in another program's window

Posted on 2009-12-17
Medium Priority
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

CSecurity earned 500 total points
ID: 26077374
Activate that textbox and try SendKeys:

Assisted Solution

JohnGaby earned 500 total points
ID: 26077582
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

ID: 31667593
This is exactly the answer I was looking for!

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

865 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