Log in

View Full Version : Fetch text from RichEdit control


emidge
September 1st, 2003, 07:56
Hello!

Getting text from anothers app via clipboard is easy. See e.g.
h**p://www.codeproject.com/cpp/msnchattext.asp?target=msn

The fun starts here.

How can one *continuoulsy* grab the text *without* clipboard?

Using EM_STREAMOUT and a callback functions would be fine but doesnt work. Why?

But how can this be done?

Your suggestions and source code appreciated :-)
I prefer simple solutions ;->

emidge

dELTA
September 1st, 2003, 11:48
Do you only want to grab the text from the clipboard, or rather grab all keyboard input? In the latter case you can create a keylogger with e.g. a Windows hook.


dELTA

disavowed
September 1st, 2003, 12:31
Quote:
Originally posted by emidge
Using EM_STREAMOUT and a callback functions would be fine but doesnt work. Why?


Assuming your code is correct, this probably means that Windows requires that the parent (of the RichEdit window) process sends EM_STREAMOUT and/or the callback function is in that process's address space. In this case, you would need to do remote process/code injection.

emidge
September 2nd, 2003, 03:29
Thanx for your answers.

To clarify things
..) the app steadily adds new lines to its RichEdit Control and purges the old ones.
..) the data is received from the net.
..) there is no need for a keylogger.

OK. One could directly patch the app, or poll the clipboard each and every second and merge the new lines with the previous ones.
But I would like to do it more elegantly.

So I came across the streaming functionality, which works perfect for my own app that uses a RichEdit control, but crashes the other app.

I also had the idea of code injection.
I read e.g. the recently published article on codeproject mentioned here on the board.
But I can not put the pieces together.

Any (other) ideas how to grab the text are appreciated.
Also working example code

disavowed
September 2nd, 2003, 10:01
Quote:
Originally posted by emidge
..) the data is received from the net.
...Any (other) ideas how to grab the text are appreciated.
packet sniffer