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. [SOLVED] How to close external application or process from QT
QtWS25 Last Chance

[SOLVED] How to close external application or process from QT

Scheduled Pinned Locked Moved General and Desktop
external applickill
5 Posts 2 Posters 3.7k 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.
  • M Offline
    M Offline
    mjzarrin
    wrote on 6 Oct 2015, 21:17 last edited by mjzarrin 10 Dec 2015, 13:03
    #1

    i need to close all browser of my system from QT.
    It must be work on Windows and Linux. i found Qprocess. I searching hours for an example of using kill or terminate for external application like google chrome but failed. can anyone help me please.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Oct 2015, 21:29 last edited by
      #2

      Hi and welcome to devnet,

      You would first need to get a list of the current running instance using e.g. ps -A. You can then parse that to retrieve the PID's of the application you want to stop and then use that to send the proper kill command.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply 11 Oct 2015, 15:48
      1
      • S SGaist
        6 Oct 2015, 21:29

        Hi and welcome to devnet,

        You would first need to get a list of the current running instance using e.g. ps -A. You can then parse that to retrieve the PID's of the application you want to stop and then use that to send the proper kill command.

        Hope it helps

        M Offline
        M Offline
        mjzarrin
        wrote on 11 Oct 2015, 15:48 last edited by
        #3

        @SGaist
        Thank you very much.
        i find solution based on your idea and the program can close any external app with it's name.
        thank you

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 11 Oct 2015, 19:20 last edited by
          #4

          You're welcome !

          Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          Also, while browsing the forum, consider up-voting the answers that helped you, that will make them easier to find for other users :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply 12 Oct 2015, 13:06
          0
          • S SGaist
            11 Oct 2015, 19:20

            You're welcome !

            Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

            Also, while browsing the forum, consider up-voting the answers that helped you, that will make them easier to find for other users :)

            M Offline
            M Offline
            mjzarrin
            wrote on 12 Oct 2015, 13:06 last edited by
            #5

            @SGaist
            Ok my dear friend.
            Thank you again for your advise.

            1 Reply Last reply
            0

            2/5

            6 Oct 2015, 21:29

            • Login

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