Groups | Blog | Home
all groups > dotnet general > april 2005 >

dotnet general : Hooking into another process?


Dan
4/1/2005 10:56:25 AM
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan
Shaun Wilson
4/1/2005 12:32:16 PM
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

[quoted text, click to view]

Seth Gecko
4/1/2005 8:33:19 PM
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

Seth Gecko
4/1/2005 9:20:38 PM
Nope, to both.

[quoted text, click to view]

AddThis Social Bookmark Button