Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Runing a .exe inside a form
Forum Updated to NodeBB v4.3 + New Features

Runing a .exe inside a form

Scheduled Pinned Locked Moved Unsolved Language Bindings
2 Posts 2 Posters 935 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HugoMendes
    wrote on last edited by HugoMendes
    #1

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

    [DllImport("user32.dll")]
    static extern IntPtr SetParent(IntPtr hwc, IntPtr hwp);

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

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

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      __jb__
      wrote on last edited by
      #2

      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.

      Regards,
      Jakob

      1 Reply Last reply
      4

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved