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

x
?
Solved

SetWindowText of Edit Box in another program's window

Posted on 2009-12-17
3
Medium Priority
?
860 Views
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.
0
Comment
Question by:Timbilt
3 Comments
 
LVL 17

Accepted Solution

by:
CSecurity earned 500 total points
ID: 26077374
Activate that textbox and try SendKeys:
http://www.codeproject.com/KB/cpp/sendkeys_cpp_Article.aspx
0
 
LVL 9

Assisted Solution

by:JohnGaby
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.

http://msdn.microsoft.com/en-us/library/ms633546%28VS.85%29.aspx
0
 

Author Closing Comment

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

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