473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Hooking into another process?

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
Nov 17 '05 #1
3 3368
Dan
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan

Nov 17 '05 #2
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

Nov 17 '05 #3
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


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Seth Gecko | last post by:
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...
1
by: Matthew Kelly | last post by:
I have pulled together a VB.net project that hooks the keyboard (Ref. Paul Kimmel's hooking program) and allow the user to send "mouse right clicks" via the SendInpuut function (mouse emulation...
79
by: pinkfloydhomer | last post by:
I want to scan a file byte for byte for occurences of the the four byte pattern 0x00000100. I've tried with this: # start import sys numChars = 0 startCode = 0 count = 0
1
by: TMP | last post by:
Below is the code snippet that I'm having problems with, the hook seems to work (hookResult returns a value other than zero) but then explorer crashes.Also I'm aware of the fact that instead of...
3
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events....
0
by: webstuff | last post by:
Hi, I have a C# .NET application with lots of strings added through the visual designer (thus stored in the form's .resx file) specifying the application's company name and product name . ...
2
by: Dave A | last post by:
I am stuggling with databinding a drop down list, hooking into the SelectedIndexChanged and attempting to avoid using the viewstate. The drop down list is quite large so I would prefer to avoid...
5
by: Ryan Ginstrom | last post by:
Apropos recent threads about GUI editors, coming from a Win32/WTL C++ background, I actually like the idea of being able to (easily) create GUIs programmatically. But I still see a lot of the...
12
by: pigeonrandle | last post by:
Hi, Is it possible to hook another application's WM_MOVE messages using c#? There seems to be some argument as to what messages you can hook and whether you can listen in on other app's messages...
8
by: pigeonrandle | last post by:
Hi, Has anyone had any experience with hooking messages in other application windows (like SPY++). I want to listen for WM_MOVE messages, but can only seem to find examples of Keyboard and Mouse...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.