Hi Sujan, I did not follow the rest of the discussion, but at least your sample code contains an error:
On Sat, Mar 21, 2020 at 7:38 AM Sujan Dasmahapatra < yellowlemontree0...@gmail.com> wrote: > [...] > > ///////////////////////////////////////////////////////////////////////////////////////////////////////// > > int main(int argc, char *argv[]) > > { > > QApplication a(argc, argv); > > QProcess *process_fusion = new QProcess(); > > process_fusion->startDetached(".\\MGL.exe C:\\T1.nii"); > > Sleep(20000); > > //0.00289917 0.28096 -0.180618 = 343 // Windows: Find HWND by window > title > > HWND id = FindWindow(NULL, L"MGL"); > > if (!id) > > return -1; > > > // Linux: Find Window ID by running xwininfo externally before compiling > this test > > //WId id = 0x4600085 > > QTimer t; > > t.start(2500); > > // Part 1 > > QWindow *window = new QWindow; > > window->setFlags(Qt::Desktop | Qt::ForeignWindow | Qt::WindowTitleHint); > > window = QWindow::fromWinId((WId)id); > > The above line *replaces *your previously created window, including the flags you set on it. Maybe this works: ... // Part 1 QWindow *window = QWindow::fromWinId((WId)id); window->setFlags(Qt::Desktop | Qt::ForeignWindow | Qt::WindowTitleHint); QWidget *widget = QWidget::createWindowContainer(window); ... QWidget *widget = QWidget::createWindowContainer(window); > > widget->show(); > > return a.exec(); > > } > //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// > > [...] > > Cheers, Rainer -- Software Engineer | Trimble Imaging Division Rotebühlstraße 81 | 70178 Stuttgart | Germany Office +49 711 22881 0 | Fax +49 711 22881 11 http://www.trimble.com/imaging/ | http://www.inpho.de/ Trimble Germany GmbH, Am Prime Parc 11, 65479 Raunheim Eingetragen beim Amtsgericht Darmstadt unter HRB 83893, Geschäftsführer: Rob Reeder, Jürgen Kesper
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest