Solved

Get text from a CEdit window in another process?

Posted on 2000-04-23
4
251 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
4 Comments
 

Accepted Solution

by:
pkkn earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Why would you ever want to do this?
0
 

Author Comment

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

Yay for Microsoft
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Running shell command from Access 3 63
iSeries FTP Exit Program 8 113
format the code in java 6 72
tripleUp challenge 7 65
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

12 Experts available now in Live!

Get 1:1 Help Now