?
Solved

Get text from a CEdit window in another process?

Posted on 2000-04-23
4
Medium Priority
?
267 Views
Last Modified: 2013-11-20
Is there any way to get the text contained in a CEdit window belonging to another process, given its HWND?
0
Comment
Question by:Further
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Accepted Solution

by:
pkkn earned 200 total points
ID: 2743142
Hai Further,

if you have the HWND, try the following lines of code to get the text from that window
 
char lpClassName[255];
if (::GetClassName(HWND,lpClassName, 255))
{
CString strWndClass
strWndClass = lpClassName;
if (0 == strWndClass.CompareNoCase("EDIT"))
{
CString strWindowText;
char szText[255];
::SendMessage(HWND, WM_GETTEXT, 255, (LPARAM)szText);
strWindowText = szText;
}

}
0
 
LVL 6

Expert Comment

by:MichaelS
ID: 2743181
As I know you have to inject into target process, get the text and transfer it to yours. You can use hook for that. Let me know if you will go this way and need addition information.
0
 
LVL 3

Expert Comment

by:altena
ID: 2745266
Why would you ever want to do this?
0
 

Author Comment

by:Further
ID: 2746219
Thanks!  That's funny that WM_GETTEXT works but GetWindowText() doesn't :)

Yay for Microsoft
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

762 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