473,473 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Get Messages from another application

Hi everyone!

I'm trying to get the windows messages sent to and from another
application.

I'm able to get the handle to this object, and I pass it into the
following function:

public class MyHookClass : NativeWindow {
public MyHookClass(IntPtr hWnd) {
// Assign the handle from the source window to this
class.
this.AssignHandle(hWnd);
}
protected override void WndProc(ref Message m) {
Console.WriteLine(m.ToString());
base.WndProc(ref m);
}
}

Problem is, nothing is ever shown.

My assumtion is that the object I'm trying to pull from is not a
NativeWindow, but when I look at it through Spy++, messages are
present.

I figure if Spy++ can do it, I should be able to also...

Any ideas?

I'm using .NET 2.0 and C#

thanks in advance

Nov 17 '05 #1
3 3011
Doesn't this do what you want?

http://www.codeproject.com/csharp/controlinspector.asp

HTH

Ollie Riches

"Capsule" <Ca******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi everyone!

I'm trying to get the windows messages sent to and from another
application.

I'm able to get the handle to this object, and I pass it into the
following function:

public class MyHookClass : NativeWindow {
public MyHookClass(IntPtr hWnd) {
// Assign the handle from the source window to this
class.
this.AssignHandle(hWnd);
}
protected override void WndProc(ref Message m) {
Console.WriteLine(m.ToString());
base.WndProc(ref m);
}
}

Problem is, nothing is ever shown.

My assumtion is that the object I'm trying to pull from is not a
NativeWindow, but when I look at it through Spy++, messages are
present.

I figure if Spy++ can do it, I should be able to also...

Any ideas?

I'm using .NET 2.0 and C#

thanks in advance

Nov 17 '05 #2
Thanks for your time Ollie!

There is some good stuff in there, but it doesn't quite do what I'm
looking for. The control in question is on a third party application
and it wasn't written in .NET.

The application you sent above only deals with.NET assemblies...

After some more research, Seems like API calls is the way to do it.
PeekMessages might be the answer, but I still need to do further
research.

Any further insight would be greatly appreciated.

Again, thanks for your time

Nov 17 '05 #3
I'm going to revive this thread... I have made progress with capturing
messages, and overriding the WndProc. I have even had success with
using the GWL_WNDPROC to redirect the WinProc output to my own
function.

However, it appears emulating the Spy++ is not possible using .NET when
it comes to third party software written in a platform other than .NET.
Has anyone had any success with something like this?

Any links or code samples would be appreciated.

Thanks,

Craig

Nov 17 '05 #4

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

Similar topics

2
by: Chris | last post by:
Hi, I have an application that contains a class library as another project. The application basically executes DTS packages on a remote SQL Server. This works great. However I want to add...
3
by: nycjay | last post by:
hello, i am just getting started as a dba. ny current task is to set up notification for health alerts. so, we have the health monitor running, and it is currently putting health alerts (space...
2
by: superseed | last post by:
Hi, I'm pretty new to C#, and I'm quite stuck on the following problem. I would like to add to my application a Windows.Form (singleton) on which I could display a message of one of the...
4
by: LhK-Soft | last post by:
Hi, I'm active in VC++ for several years now, so I know some things (I think). Using MS-Access I store a db with lots of entries and uses the VBA techniques to export those data to e.g. HTML, XML...
5
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
8
by: Gerald Bader | last post by:
Hi all! Is there a possibility to send messages from one application to another, never minding if it is a .NET or a COM application? The other application should "listen" whether there are...
6
by: Ed Leafe | last post by:
I've been approached by a local business that has been advised that they need to start capturing and archiving their instant messaging in order to comply with Sarbanes-Oxley. The company is largely...
0
by: pigeonrandle | last post by:
Hi, I realise that this question has been asked a million times already, but i cannot seem to find the answer i am looking for ... I suspect that i need to combine different methods, and this is...
1
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.