Get TextBox focus in WPF app from plugins in separate process

200 Views Asked by At

We are using the System.AddIn structure for creating an application for hosting apps. What we would like is to hook up to the event that a TextBox gets focus in these separate apps.

How can we do that?

I know the processes, so I can access those and maybe listen on the message pump? But how? What messages to listen for and how to determine if that control getting focus is actually a TextBox (WPF type)?

Hope for your help!

2

There are 2 best solutions below

0
On

For now we are investigating the possibility of using the EventManager.RegisterClassHandler method, to register in the separate appdomain and handle the implementation in the adapter for each developer.

1
On

I don't think you can do it in an "out of the box" way.

A solution could be create a duplex WCF service exposed by all wpf processes.

Then the client can connect to the services and use a Register method to listen to events.

The service implementation will then dispatch events to the registered clients. It takes some time but I think it is the only way.