Re: [Development] How to get winid from qprocess id for QProcess
On Thu, Feb 20, 2020 at 5:36 PM Sujan Dasmahapatra wrote: > I am running an external app, which I want to fit onto my QScrollArea, for > this I am writing code like this. > > // launch weasis > QProcess *process = new QProcess(); > process->start("./viewer-win32.exe"); > if (process->waitForFinished()) > { > return; > } > > QWindow *window = QWindow::fromWinId(211812356); > window->setFlags(Qt::FramelessWindowHint); > _patient_gui->scrollArea_1->setWidget(QWidget::createWindowContainer(window)); > > But how can I get the wind id? it is hard coded here, is there any way to get > the id from process id. > > any help is highly appreciated. > Dear Sujan The direction is to enumerate currently running windows of a particular process and to find the right one, i.e. by title. You can start here: https://docs.microsoft.com/en-us/windows/win32/psapi/enumerating-all-processes https://stackoverflow.com/questions/42589496/getting-a-list-of-all-open-windows-in-c-and-storing-them Take care, Robert Iakobashvili ___ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development
Re: [Development] How to get winid from qprocess id for QProcess
I think this question is better suited to the qt-interest mailing list. It has been decades since I did Win32 programming, but I would assume that you could ask Windows to find the window for you and give you the HWND. I don't think you can map from process to HWND, you'd have to map HWND to process? But my days of programming Win32 are long over. Thank you, Qt! Sent: Thursday, February 20, 2020 at 9:36 AM From: "Sujan Dasmahapatra" To: development@qt-project.org Subject: [Development] How to get winid from qprocess id for QProcess hi friend I am running an external app, which I want to fit onto my QScrollArea, for this I am writing code like this. // launch weasis QProcess *process = new QProcess(); process->start("./viewer-win32.exe"); if (process->waitForFinished()) { return; } QWindow *window = QWindow::fromWinId(211812356); window->setFlags(Qt::FramelessWindowHint); _patient_gui->scrollArea_1->setWidget(QWidget::createWindowContainer(window)); But how can I get the wind id? it is hard coded here, is there any way to get the id from process id. any help is highly appreciated. ___ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development ___ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development
[Development] How to get winid from qprocess id for QProcess
hi friend I am running an external app, which I want to fit onto my QScrollArea, for this I am writing code like this. // launch weasis QProcess *process = new QProcess(); process->start("./viewer-win32.exe"); if (process->waitForFinished()) { return; } QWindow *window = QWindow::fromWinId(211812356); window->setFlags(Qt::FramelessWindowHint); _patient_gui->scrollArea_1->setWidget(QWidget::createWindowContainer(window)); But how can I get the wind id? it is hard coded here, is there any way to get the id from process id. any help is highly appreciated. ___ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development