订阅专栏
最近写各小工具,需要嵌入他人的程序,所以记录一下使用方式:
void createFrame::on_pushButton_6_clicked() {
removeLayout(ui->widget, ui->widget->layout());
d698_exe = QCoreApplication::applicationDirPath() +
QString("/App/TopsParser/TopsParser.exe");
isStopFind = true;
procThreExec.start(d698_exe);
QTimer::singleShot(6000, this, &createFrame::stopFindWindow/* 可以用lamba语句 这里就是将标志位 isStopFind == false */);
while (isStopFind) {
wid645 =
(WId)FindWindow(L"TMainFrm", L"通讯报文解析工具__V1.0.2.1_141215");
if (wid645 == 0) {
continue;
}
break;
}
if (isStopFind == false)
return;
mWin = QWindow::fromWinId(wid645);
mWin->setFlags(mWin->flags() | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
mWidget = QWidget::createWindowContainer(mWin);
/* resize大小控制 */
resize(1333,