0

I am trying to host a window of a QT application inside a windowsforms/wpf application. I have already seen a lot of questions and answers on this question. But they don't work for me (the window doesn't show up in the wpf form and remains running on its own). I got an application that must be launched in administrator mode on windows. When I try to embed/host it in my application with SetParent it does not show up, and SetParent returns 0.

Other applications like notepad++ do work, do I need to do additional steps to host an administrator-mode window?

Edit 1:

        int h = FindWindow(null, "Game Browser");
        IntPtr hwnd = (IntPtr)h;
        // Both h and hwnd are set to correct values

        var helper = new WindowInteropHelper(this);
        var x = SetParent(hwnd, helper.Handle);
        // x remains 0, helper.Handle returns a seemingly correct value

        // remove control box
        int style = GetWindowLong(hwnd, GWL_STYLE);
        style = style & ~WS_CAPTION & ~WS_THICKFRAME;
        SetWindowLong(hwnd, GWL_STYLE, style);
H.J. Meijer
  • 379
  • 2
  • 13

1 Answers1

0

Answer: external App inside WPF (notepad.exe works but others don't). In short, this is not possible since OLE is not supported by most apps.

H.J. Meijer
  • 379
  • 2
  • 13