Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. check if external app is already running

check if external app is already running

Scheduled Pinned Locked Moved C / C++ / MFC
question
9 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • E Offline
    E Offline
    elephantstar
    wrote on last edited by
    #1

    Is there a simple way of checking to see if an external application, say Microsoft Word, is already running before creating a new process via CreateProcess? Thanks!

    S T 2 Replies Last reply
    0
    • E elephantstar

      Is there a simple way of checking to see if an external application, say Microsoft Word, is already running before creating a new process via CreateProcess? Thanks!

      S Offline
      S Offline
      Saksida Bojan
      wrote on last edited by
      #2

      Yes. You can use FindWindow command (win32 api).

      B 1 Reply Last reply
      0
      • S Saksida Bojan

        Yes. You can use FindWindow command (win32 api).

        B Offline
        B Offline
        Blake Miller
        wrote on last edited by
        #3

        FindWindow :wtf: See EnumProcesses instead. Marriage slows down your coding, a baby slows it down even more!

        T 1 Reply Last reply
        0
        • B Blake Miller

          FindWindow :wtf: See EnumProcesses instead. Marriage slows down your coding, a baby slows it down even more!

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          Blake Miller wrote:

          FindWindow

          DAMM, FindWindow again!

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV

          1 Reply Last reply
          0
          • E elephantstar

            Is there a simple way of checking to see if an external application, say Microsoft Word, is already running before creating a new process via CreateProcess? Thanks!

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            elephantstar wrote:

            Is there a simple way of checking to see if an external application,

            look for Process32First and Process32Next apis

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV

            E 1 Reply Last reply
            0
            • T ThatsAlok

              elephantstar wrote:

              Is there a simple way of checking to see if an external application,

              look for Process32First and Process32Next apis

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

              cheers, Alok Gupta VC Forum Q&A :- I/ IV

              E Offline
              E Offline
              elephantstar
              wrote on last edited by
              #6

              Thanks, that worked. I also have another question. I was planning on using AttachThreadInput() to bring the application to the front but I wasn't sure how to obtain the thread id. Any help is much appreciated. Thanks.

              T 3 Replies Last reply
              0
              • E elephantstar

                Thanks, that worked. I also have another question. I was planning on using AttachThreadInput() to bring the application to the front but I wasn't sure how to obtain the thread id. Any help is much appreciated. Thanks.

                T Offline
                T Offline
                ThatsAlok
                wrote on last edited by
                #7

                elephantstar wrote:

                was planning on using AttachThreadInput() to bring the application to the front

                Any particular reason for using it !

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                cheers, Alok Gupta VC Forum Q&A :- I/ IV

                1 Reply Last reply
                0
                • E elephantstar

                  Thanks, that worked. I also have another question. I was planning on using AttachThreadInput() to bring the application to the front but I wasn't sure how to obtain the thread id. Any help is much appreciated. Thanks.

                  T Offline
                  T Offline
                  ThatsAlok
                  wrote on last edited by
                  #8

                  elephantstar wrote:

                  I was planning on using AttachThreadInput() to bring the application to the front

                  any particular reason to use that api..... anyway use CreateToolhelp32Snapshot with TH32CS_SNAPTHREAD to get thread list associated with it.

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                  cheers, Alok Gupta VC Forum Q&A :- I/ IV

                  1 Reply Last reply
                  0
                  • E elephantstar

                    Thanks, that worked. I also have another question. I was planning on using AttachThreadInput() to bring the application to the front but I wasn't sure how to obtain the thread id. Any help is much appreciated. Thanks.

                    T Offline
                    T Offline
                    ThatsAlok
                    wrote on last edited by
                    #9

                    elephantstar wrote:

                    I was planning on using AttachThreadInput() to bring the application to the front

                    any particular reason for using it,anyway use CreateToolhelp32Snapshot with TH32CS_SNAPTHREAD to get list of thread

                    "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                    cheers, Alok Gupta VC Forum Q&A :- I/ IV

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups