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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Process Info

Process Info

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 5 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.
  • S Offline
    S Offline
    Subramaniam s V
    wrote on last edited by
    #1

    how do i find out if a particular process is running or not. I have the ProcessID with me for reference. I dont wanna use OpenProcess method. Is there any other way.

    M N H stefanmihaimogaS 4 Replies Last reply
    0
    • S Subramaniam s V

      how do i find out if a particular process is running or not. I have the ProcessID with me for reference. I dont wanna use OpenProcess method. Is there any other way.

      M Offline
      M Offline
      Monty2
      wrote on last edited by
      #2

      you can enumerate running processes if you have the name of the executable and match the filenames. BTW, if you just want to check whether IE is running or not then this code snippet will work just fine

      HWND hExplorer = ::FindWindow("IEFrame", NULL);
      if (!hExplorer)
      {
      hExplorer = ::FindWindow("CabinetWClass", NULL);
      }
      if(hExplorer)
      {
      //running
      }


      C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg

      1 Reply Last reply
      0
      • S Subramaniam s V

        how do i find out if a particular process is running or not. I have the ProcessID with me for reference. I dont wanna use OpenProcess method. Is there any other way.

        N Offline
        N Offline
        Naveen
        wrote on last edited by
        #3

        why not openprocess? nave

        1 Reply Last reply
        0
        • S Subramaniam s V

          how do i find out if a particular process is running or not. I have the ProcessID with me for reference. I dont wanna use OpenProcess method. Is there any other way.

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          you can use hProcess = OpenProcess (PROCESS_QUERY_INFORMATION|PROCESS_VM_READ, FALSE, yourID); openprocess/EnumProcessModules/GetModuleFileNameEx/ First you should Handle to process and then you can use this function and other functions....

          1 Reply Last reply
          0
          • S Subramaniam s V

            how do i find out if a particular process is running or not. I have the ProcessID with me for reference. I dont wanna use OpenProcess method. Is there any other way.

            stefanmihaimogaS Offline
            stefanmihaimogaS Offline
            stefanmihaimoga
            wrote on last edited by
            #5

            Hi, if you already know the ProcessID you can use EnumProcesses function, instead of OpenProcess - it will tell you if the specified process is running. Good Luck!

            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