473,805 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 SetWindowsHookE x, but the
hook I should use, I am not so sure about. WM_GETTEXT seems the only real
option. Another problem is that SetWindowsHookE x 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 SetWindowsHookE x 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
3 1699
Dan
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan

Jul 21 '05 #2
Nope, to both.

"Dan" <da************ *@yahoo.com> wrote in message
news:11******** *************@l 41g2000cwc.goog legroups.com...
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan

Jul 21 '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*****@NOSPAM hotmail.com> wrote in message
news:O6******** *****@TK2MSFTNG P15.phx.gbl...
Nope, to both.

"Dan" <da************ *@yahoo.com> wrote in message
news:11******** *************@l 41g2000cwc.goog legroups.com...
Is the other app (the one with the Richedit) in .net and under your
control?

-Dan


Jul 21 '05 #4

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

Similar topics

1
5371
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 works fine). I am also trying to make this project capable of "Rearrange the keyboard" (example type "e" and "K" is sent to the application) by using SendInput function and I am not able to get it to work. I am finding the use of SendInput...
79
5301
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
2406
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 specifying a dll with my hook function embedded, I used my executable's module HINSTANCE. But I guess no problem there since it works with different hook types.So can anyone explain why explorer keeps crashing? (on Windows XP Professional) Thanks in...
3
3397
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 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...
0
1117
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 . What I want to do is change all of these instances to tags, for example <COMPANY_NAME> or <PRODUCT_NAME> and then dynamically replace these tags when the application runs with a company name/product name etc of my choosing.
2
3042
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 using the view state so I set EnableViewState on the page to false. To enable the drop down list to bind to a datasource I bind it during the OnInit. I do a response.Write during the SelectedIndexChanged event to verify that the event fires. ...
5
2021
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 same tedium: hooking up events to handlers, and getting data into and out of dialogs. In C++, this is generally handled through code generation and/or macros, but IMO these are brittle and ugly. So my question: Is there a Pythonic way to make...
12
2706
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 using .net. I'm just looking for a straight answer really? Thanks, James Randle
8
1975
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 hooks. Please (and thankyou), James Randle.
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7644
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.