I have a legacy C ++ win32 application and its extension using wpf windows works.
But what I want to do is the WPF window as the main window, and not just any old window, but the prism shell window.
So, to my C ++ project for old projects, I want to add Bootstrapper, shell window, MEF loader, all bells and whistles. And there I want to put some commands that open old win32 windows when they are needed.
Now, to open WPF windows in a win32 application, you just need to use
System::Windows::Forms::Integration::ElementHost::EnableModelessKeyboardInterop(mywindow);
But how to open win32 window in WPF application? The win32 window will require a message pump circuit, but where can I put this:
MSG msg; while (GetMessage(&msg, NULL, NULL, NULL)) { TranslateMessage(&msg); DispatchMessage(&msg); }
Is it possible to create a new thread for a loop? Or is there an assistant for this too?
Or is my idea crazy?
source share