By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,200 Members | 1,612 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,200 IT Pros & Developers. It's quick & easy.

Hooking into another process?

P: n/a
Hi

I want to make an application (in C#) that can catch text written to a
Richedit control in another application. Using Spy++ I can see that the
message I want to intercept is called EM_REPLACESEL. I have been googling
and I am pretty sure that the way forward is using SetWindowsHookEx, but the
hook I should use, I am not so sure about. WM_GETTEXT seems the only real
option. Another problem is that SetWindowsHookEx used from .Net will only
work on the same process, is this correct? Could I instead use a GetDlgItem,
but will this work on a window in another process?

As You properly can see, I am more than a little confused about the subject
atm. Could anyone please give me some directions (I have read the articles
from CuttingEdge, but it only seem to confirm that SetWindowsHookEx will
work within the same process)? Is there perhaps a free C dll which will
install a hook into the other process?

Thanks

Seth Gecko
Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Dan
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan

Jul 21 '05 #2

P: n/a
Nope, to both.

"Dan" <da*************@yahoo.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan

Jul 21 '05 #3

P: n/a
The problem you will face is your code will be executing in the wrong
process space.

I suggest getting Advanced Windows Programming 5th edition (or later?) buy
richter, it has several chapters dedicated toprocess hooking, including
global hooks and a complete discussion of dll injection techniques.

You will need this knowledge.

- SEWilson

"Seth Gecko" <se*****@NOSPAMhotmail.com> wrote in message
news:O6*************@TK2MSFTNGP15.phx.gbl...
Nope, to both.

"Dan" <da*************@yahoo.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan


Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.