Get Application Name ..

  • @
    #include <QtCore/QCoreApplication>
    #include <QProcess>
    #include <QDebug>

    int main(int argc, char *argv[])
    QCoreApplication a(argc, argv);

    QProcess process;

    // process.start("cmd.exe /C echo test");
    process.start("wmic.exe /OUTPUT:STDOUT PROCESS get Caption");

    QByteArray list = process.readAll();
    qDebug() << "Read" << list.length() << "bytes";
    qDebug() << list;


    I use this program to list out all process which are running.. but i want to get application names which started by user and they are at running vlc media player,ms word etc. ..

    Thanks in advance..

    Gerolf: Added code tags

  • Moderators

    Please use "code wrappings as explained here": This makes your code readable.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.