Yes, we actually did figure out a work around. What we did is we
created an implementation of IMessageFilter then added a new
MessageFilter instance to each of the newly created AppDomains as well
as the initial AppDomain. Our implementation of IMessageFilter adds a
parent reference which is also an instance of IMessageFilter. In our
shortcut key case (CTRL+SHIFT+....) the MessageFilter passes the message
to the parent MessageFilter if the parent is not null. You will also
need to add a serializable method in MessageFilter to pass the call
across AppDomains and make sure to do an Invoke on this serializable
method to make sure it runs on the correct Thread. A side effect of our
implementation is it is possible for the parent and the child AppDomains
to both process the same message so one user interaction causes two
actions. This could be handled by adding an interface to each of your
objects being run in separate AppDomains which contains a method such as
the following:
public bool IsMessageHandler(int keys);
which is implemented on each AppDomains primary class to designate
whether that class handles the passed keys. Then you just need to check
the current app domain and the parent appdomain (if it exists) using
this method to determine if the keys need to be processed.
Hope that helps. Let me know if any of this is confusing or needs
clarification.
Mike
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!