Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to confirm whether some process is opened by process name?
Forum Updated to NodeBB v4.3 + New Features

How to confirm whether some process is opened by process name?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 794 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    angelyouyou
    wrote on last edited by angelyouyou
    #1

    My application opened one pcap file with wireshark with specify name.
    I want to know how to confirm whether the process is opened by process name.
    Process name examples:
    pcap_file_2021-07-01-20-46-36.pcap
    pcap_file_2021-07-01-20-20-01.pcap
    ....

    JonBJ 1 Reply Last reply
    0
    • A angelyouyou

      My application opened one pcap file with wireshark with specify name.
      I want to know how to confirm whether the process is opened by process name.
      Process name examples:
      pcap_file_2021-07-01-20-46-36.pcap
      pcap_file_2021-07-01-20-20-01.pcap
      ....

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @angelyouyou
      You will need to use native calls for whatever your OS is to achieve this.

      1 Reply Last reply
      1
      • A Offline
        A Offline
        angelyouyou
        wrote on last edited by
        #3

        I saved the QProcess pointer of the opened wireshark process, can I use it to judge whether the process is opened?
        I open the wireshark process by StarDetached API, but
        I can't confirm the process is running.

        JonBJ 1 Reply Last reply
        0
        • C Offline
          C Offline
          ChrisW67
          wrote on last edited by ChrisW67
          #4

          @angelyouyou said in How to confirm whether some process is opened by process name?:

          I want to know how to confirm whether the process is opened by process name.

          If QProcess::startDetatched() returns true, then the process has started.
          It also gives you the process ID (pid) if that is of use.

          1 Reply Last reply
          0
          • A angelyouyou

            I saved the QProcess pointer of the opened wireshark process, can I use it to judge whether the process is opened?
            I open the wireshark process by StarDetached API, but
            I can't confirm the process is running.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @angelyouyou
            You need to more specific about what exactly you are looking for/how these processes are started.

            If you are only interested in processes which you launched via Qt's QProcess you might check via PID instead of name. Or you can look at QProcess::program() for each process. However, the examples you show do not look like the names of launchable processes, but who knows because you don't say what the program name(s) is/are when you launch them.

            I read your requirement as "Use OS-specific call to list the names of all running processes, and compare names against what I am looking for". Otherwise I don't know why you are interested in process names. But perhaps you do mean only processes your Qt app has launched, in which case I have indicated PID or maybe QProcess::name() is what you are interested in.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved