導航:首頁 > 編程語言 > qt關閉應用程序

qt關閉應用程序

發布時間:2023-09-14 08:46:14

A. QT 啟動與關閉外部程序

啟動

QString filepath = QDir::currentPath();

    QString fullpath = filepath+"\\pp\\dist\\start";

    QString title = fullpath+"\\main.exe";

    title = title.replace("/","\\");

    fullpath = fullpath.replace("/","\\");

   襪答 QProcess p(this);

    p.setWorkingDirectory(fullpath);

    p.start("cmd", QStringList()<<"/c"<<"start main.exe");

    p.waitForStarted();

    p.waitForFinished();

關閉

    QProcess p(this);

    p.setWorkingDirectory(fullpath);

   慶洞 p.start("告差慧cmd", QStringList()<<"/c"<<"taskkill /f /t /im main.exe");

    p.waitForStarted();

    p.waitForFinished();

閱讀全文

與qt關閉應用程序相關的資料

熱點內容
打開找不到路徑的文件怎麼辦 瀏覽:94
澄海3c545地圖放到那個文件夾里 瀏覽:540
華為手機qq文件打開方式打開方式 瀏覽:856
手機如何刪除刪除不了的app 瀏覽:212
編程怎麼走好路 瀏覽:417
小米游戲數據一般在哪個文件 瀏覽:902
桌面伺服器是哪個文件 瀏覽:965
二進制數據類型的長度為什麼是n4 瀏覽:561
js獲取當前js文件的路徑 瀏覽:106
adobeindesigncs6教程 瀏覽:909
猿編程怎麼玩游戲 瀏覽:603
win8無網路訪問許可權 瀏覽:121
一個資料庫大小限制多少g 瀏覽:760
無限斯特拉托斯可以用哪些app看 瀏覽:954
圖片與拍攝文件大小名詞解釋 瀏覽:229
java的classpath配置文件 瀏覽:286
在小年魚app裡面如何退款 瀏覽:143
網路電話哪個軟體好用嗎 瀏覽:386
pokemon叫聲文件 瀏覽:689
工程源文件路徑 瀏覽:137

友情鏈接