views:

28

answers:

1

I have a situation where I need to start a WPF application and have it run using a child window created by my C++ application. So the sequence of events would be -

  1. Start C++ application
  2. C++ application creates a window that it wants WPF app to run in.
  3. Launch WPF using CreateProcess function. Included in create process would be the handle of the window that the WPF app is to use.

It looks like this should be possible, but I cannot find function calls/parameters to do this. This will be in a Windows XP and Windows 7 environment.

A: 

You should setup the WPF program as a library, not an application. You could then provide it's user interface with direct access to your "child window", which it could host directly or via HwndHost.

Trying to launch a separate process, and share a window via a HWND cross process is going to be very problematic.

Reed Copsey