Qt World Summit: Submit your Presentation

Runing a .exe inside a form

  • I want to run a external application inside a window created in Qt. In Visual Studio using c# I can do:

    static extern IntPtr SetParent(IntPtr hwc, IntPtr hwp);

    Process p = Process.Start("calc.exe");
    SetParent(p.MainWindowHandle, this.Handle);

    This way calculator from Windows will be inside my application. Can we do the same with Qt?

  • Hi HugoMandes,

    see the Qt-Documentation -> http://doc.qt.io/qt-5/qprocess.html
    It's also possible to get the window handle from the Qt Widget (http://doc.qt.io/qt-5/qwidget.html#winId).

    But in the past I want to embedded the Microsoft Excel inside the Qt application and this not work very well. I think it's easier to use only the microsoft eco system if possible - or a work around before embedding/drawing/event-handling a application inside a Qt application.


Log in to reply