2

I use an approach similar to http://www.codeproject.com/Articles/516431/Baktun-Shell-Hosting-WPF-Child-Windows-in-Another to host WPF applications (plugins) in another process via the AddInHost (derived from HwndHost) class.

This works fine so far as long as I don't suspend the child process. If I do so then also the parent process is frozen. The reason for this is that the parent/child processes are sharing the same (synchronous) Input Queue: Good or evil - SetParent() win32 API between different processes

I have already tried to decouple the two processes before I suspend the plugin process with the SetParent Win32 function but even the plugin is then decoupled from the host-application it does not help to get rid of the problem:

public static void Decouple(HwndHost hwndHost)
{
  SetParent(hwndHost.Handle, IntPtr.Zero);
}

Any ideas what I am missing here to separate the two processes so that they don't share the same input queue any longer?

Community
  • 1
  • 1
obi111
  • 31
  • 4
  • 1
    The general problem is also good explained here: http://stackoverflow.com/questions/16817112/parent-window-freezes-when-child-window-freezes-altough-its-from-another-proces – obi111 Nov 10 '16 at 12:04

1 Answers1

1

For me the solution was to use AttachThreadInput Win32 API function to detach the plugin HwndHost input queue

obi111
  • 31
  • 4