External application events

  • Thread starter Thread starter John J. Hughes II
  • Start date Start date
J

John J. Hughes II

Can one application consume an event from another running application? I
would assume this is what is happen when an application monitors lets say a
port. I have accomplished something similar with remoting but find this to
be a flaky and hard to implement for the user. The two applications with
always be on the same computer.

Regards,
John
 
As both applications would be in different processes, you would need OS IPC
primitives for this. I would probably use a named win32 Event for this, but
would depend on your needs.
 
Hi John,

Thanks for posting in this group.
Based on my understanding, you want to make an application that can capture
another application's changes(events), that is a monitor application.
This is however a big topic, it based on the application you wanted to
monitor.

If another application is a .Net managed application, the recommanded
interprocess communication way is remoting which can also be used on the
same machine.
As you said, you already know how to get this done.

If you wanted to monitor some certain applications such as office series,
you can use automation(add com reference), which is very convenient for you.
For more information, please search automation in MSDN or KB.

If you wanted to monitor a common win32 application which is writen by
yourself, you can P/invoke many of these conventional interprocess
communication technicals such as named pipe, CopyData windows message,
Memory Mapping File, to get this done.(Actually, the named pipe, CopyData
use MMF under the hood).
For more information, please refer to win32 books talk about interprocess
communication.

If you wanted to monitor a win32 application, you know little about, I
think you should use Spy++ or other tools to undertand its mechanism, then
P/invoke remote hook to inject a unmanaged dll into that application's
process space. For more information, please refer to hook in MSDN.

Btw: for the first situation, beside remoting, you also can P/invoke all
those win32 interprocess communication technicals: MMF, named pipe, etc.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Thanks for the response... I will try the named pipe in the other response
first because it will afford me the option of sending data too but I will
certainly keep this in mind.

Regard,
John
 
Thanks for the response... I will try the named pipe being the one I am
mostly likely able to accomplish in a short time.

Regards,
John
 
Back
Top