468,491 Members | 2,072 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,491 developers. It's quick & easy.

Intercepting Another Application's Events

I have been tasked with a project that I do not think can be accomplished.

Our company has an application that runs as an unmanaged ActiveX control on
user desktops. It is designed to work with our phone system.

When a phone call comes in, users can click a button on the ActiveX control
and begin recording.

My task is to fire off this recording, behind the scenes, without user
interaction, using the existing instance of the ActiveX control. The control
has an extensive API that I can use IF I were creating a separate
application, but basically I have to create an application that sits in the
system tray (ok), and have it behave as an event sink for this external
control (not ok).

There is other functionality I have to perform without user action, but if I
can at least manage this, I can work out the rest.

Personally, I dont think its possible. If it is, the only thing I can think
of is somehow accessing its process space and intercept its threads, but to
do what?

Any direction is GREATLY appreciated. Thank you to the community.


Nov 20 '05 #1
4 3738
> I have been tasked with a project that I do not think can be accomplished.

Pretty much everything is possible. Just desire to make it happen.
Our company has an application that runs as an unmanaged ActiveX control on user desktops. It is designed to work with our phone system.

When a phone call comes in, users can click a button on the ActiveX control and begin recording.

My task is to fire off this recording, behind the scenes, without user
interaction, using the existing instance of the ActiveX control. The control has an extensive API that I can use IF I were creating a separate
application, but basically I have to create an application that sits in the system tray (ok), and have it behave as an event sink for this external
control (not ok).

Don't understand the "If I were creating a separate application"... and
then immediatly followed by "I have to create an application."

And then you say API... well... it sounds like you have all the ingredients
you need to make this thing work.

there is also the win32 API and you could intercept messages to / from the
application...

There is other functionality I have to perform without user action, but if I can at least manage this, I can work out the rest.

Personally, I dont think its possible. If it is, the only thing I can think of is somehow accessing its process space and intercept its threads, but to do what?

Again... you have an API... so I don't quite understand what your problem
is...
Any direction is GREATLY appreciated. Thank you to the community.


Nov 20 '05 #2
CJ:

Thanks for the reply. Let me clarify the items you asked about.

" The control has an extensive API that I can use IF I were creating a
separate application.."
By this I mean if I were creating a separate winform that had the ActiveX
control dropped on it, I could use the ActiveX's API to access all the
events raised by it.

And here is where my question lies. Instead of doing the above, I need to do
what you describe later in your reply: Intercept messages and events as they
are raised in this external application and catch them in my system tray
application.

further research Ive done seems to point me to creating a "hook" DLL (this
is an example I found:
http://www.codeproject.com/dll/hooks...nts#xx748053xx)

but its written in C (which is OK I guess). Can I use VB.Net to intercept
the messages from the application? In this case, I would want to intercept
the event that is fired when a call comes in, so I could "force" the
application to record. Bear in mind that I dont want my system tray app to
record, I want it to cause the existing ActiveX control to fire its own
Record event... hope that clears it up.

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
I have been tasked with a project that I do not think can be accomplished.
Pretty much everything is possible. Just desire to make it happen.
Our company has an application that runs as an unmanaged ActiveX control

on
user desktops. It is designed to work with our phone system.

When a phone call comes in, users can click a button on the ActiveX

control
and begin recording.

My task is to fire off this recording, behind the scenes, without user
interaction, using the existing instance of the ActiveX control. The

control
has an extensive API that I can use IF I were creating a separate
application, but basically I have to create an application that sits in

the
system tray (ok), and have it behave as an event sink for this external
control (not ok).


Don't understand the "If I were creating a separate application"... and
then immediatly followed by "I have to create an application."

And then you say API... well... it sounds like you have all the

ingredients you need to make this thing work.

there is also the win32 API and you could intercept messages to / from the
application...

There is other functionality I have to perform without user action, but
if I
can at least manage this, I can work out the rest.

Personally, I dont think its possible. If it is, the only thing I can

think
of is somehow accessing its process space and intercept its threads, but

to
do what?


Again... you have an API... so I don't quite understand what your problem
is...
Any direction is GREATLY appreciated. Thank you to the community.



Nov 20 '05 #3
This is a good hook example of using the Win API, as I mentioned in my first
post for intercepting messages. But you have to know what messages your
looking for.

Second, you may want to check to see if the events contained in your active
x control are shared or not, becuase you can still drop an active x control
into a service, and if it has shared events (static whatever) then you're
job will be easy.

I think the hook example is a little extreme. And C is your only choice
because of the way it injects itself into the process. Managed doesn't have
this ability.
"Curious Coder" <ih***@noemail.com> wrote in message
news:Ow*************@TK2MSFTNGP10.phx.gbl...
CJ:

Thanks for the reply. Let me clarify the items you asked about.

" The control has an extensive API that I can use IF I were creating a
separate application.."
By this I mean if I were creating a separate winform that had the ActiveX
control dropped on it, I could use the ActiveX's API to access all the
events raised by it.

And here is where my question lies. Instead of doing the above, I need to do what you describe later in your reply: Intercept messages and events as they are raised in this external application and catch them in my system tray
application.

further research Ive done seems to point me to creating a "hook" DLL (this
is an example I found:
http://www.codeproject.com/dll/hooks...nts#xx748053xx)
but its written in C (which is OK I guess). Can I use VB.Net to intercept
the messages from the application? In this case, I would want to intercept
the event that is fired when a call comes in, so I could "force" the
application to record. Bear in mind that I dont want my system tray app to
record, I want it to cause the existing ActiveX control to fire its own
Record event... hope that clears it up.

"CJ Taylor" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
I have been tasked with a project that I do not think can be accomplished.
Pretty much everything is possible. Just desire to make it happen.
Our company has an application that runs as an unmanaged ActiveX control
on
user desktops. It is designed to work with our phone system.

When a phone call comes in, users can click a button on the ActiveX

control
and begin recording.

My task is to fire off this recording, behind the scenes, without user
interaction, using the existing instance of the ActiveX control. The

control
has an extensive API that I can use IF I were creating a separate
application, but basically I have to create an application that sits
in the
system tray (ok), and have it behave as an event sink for this
external control (not ok).


Don't understand the "If I were creating a separate application"... and
then immediatly followed by "I have to create an application."

And then you say API... well... it sounds like you have all the

ingredients
you need to make this thing work.

there is also the win32 API and you could intercept messages to / from

the application...

There is other functionality I have to perform without user action,
but if
I
can at least manage this, I can work out the rest.

Personally, I dont think its possible. If it is, the only thing I can

think
of is somehow accessing its process space and intercept its threads,

but to
do what?


Again... you have an API... so I don't quite understand what your problem is...
Any direction is GREATLY appreciated. Thank you to the community.




Nov 20 '05 #4
Ok - I have come across this article in the MSDN that discusses intercepting
events using windows hooks:
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

Is it safe to say that I can use this approach, I just need to know the name
of the message that is being raised (like CJ suggested)?

"Curious Coder" <ih***@noemail.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
I have been tasked with a project that I do not think can be accomplished.

Our company has an application that runs as an unmanaged ActiveX control on user desktops. It is designed to work with our phone system.

When a phone call comes in, users can click a button on the ActiveX control and begin recording.

My task is to fire off this recording, behind the scenes, without user
interaction, using the existing instance of the ActiveX control. The control has an extensive API that I can use IF I were creating a separate
application, but basically I have to create an application that sits in the system tray (ok), and have it behave as an event sink for this external
control (not ok).

There is other functionality I have to perform without user action, but if I can at least manage this, I can work out the rest.

Personally, I dont think its possible. If it is, the only thing I can think of is somehow accessing its process space and intercept its threads, but to do what?

Any direction is GREATLY appreciated. Thank you to the community.


Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Fenix | last post: by
6 posts views Thread by Valery Polyakov | last post: by
reply views Thread by hades5k | last post: by
7 posts views Thread by John | last post: by
2 posts views Thread by Steve McLellan | last post: by
3 posts views Thread by pamelafluente | last post: by
reply views Thread by Gabriel Genellina | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.