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. What is Name of my process

What is Name of my process

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelpquestion
4 Posts 3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello, I am C++/VC++ developer. Many times for debugging we need to attach running project to our code. My project is huge. There are whole lot of processes are running. Suppose I have a code and I wanted to attach with process. I don't know name of process I wanted to attach with. Is there any way by which I can identify name of the process from my code (or IDE). I highly appropriate, any help regarding this concern. Thanks and Regards Happy Programming.

    L A S 3 Replies Last reply
    0
    • L Lost User

      Hello, I am C++/VC++ developer. Many times for debugging we need to attach running project to our code. My project is huge. There are whole lot of processes are running. Suppose I have a code and I wanted to attach with process. I don't know name of process I wanted to attach with. Is there any way by which I can identify name of the process from my code (or IDE). I highly appropriate, any help regarding this concern. Thanks and Regards Happy Programming.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi, The operating system uses process identifiers (PID) from 0xC through 0x41DC to uniquely identify a process and is always (pid % 4 == 0) because of tag bits. You can use GetWindowThreadProcessId [^]to identify PID of other GUI processes or GetCurrentProcessId [^]for your current process. If you want the filename of current process you can use the GetModuleFileName Function[^] with GetCurrentProcess[^] Best Wishes, -David Delaune

      1 Reply Last reply
      0
      • L Lost User

        Hello, I am C++/VC++ developer. Many times for debugging we need to attach running project to our code. My project is huge. There are whole lot of processes are running. Suppose I have a code and I wanted to attach with process. I don't know name of process I wanted to attach with. Is there any way by which I can identify name of the process from my code (or IDE). I highly appropriate, any help regarding this concern. Thanks and Regards Happy Programming.

        A Offline
        A Offline
        Abhi Lahare
        wrote on last edited by
        #3

        Here [^]is the link on how to get list of all process.

        1 Reply Last reply
        0
        • L Lost User

          Hello, I am C++/VC++ developer. Many times for debugging we need to attach running project to our code. My project is huge. There are whole lot of processes are running. Suppose I have a code and I wanted to attach with process. I don't know name of process I wanted to attach with. Is there any way by which I can identify name of the process from my code (or IDE). I highly appropriate, any help regarding this concern. Thanks and Regards Happy Programming.

          S Offline
          S Offline
          Stefan_Lang
          wrote on last edited by
          #4

          If you mean to attach a debugger to the running executable of your code, then, usually, your debugger will have a means to do that. E. g. in Visual Studio you select the menu Debug-->Processes to get a list of processes that are currently running, and then choose one of that list to attach to. If your code is part of a specific program, the name of that program defines the name of the process. If this program spawns multiple threads, you will still need to attach to that program - it will cause the debugger to attach to all threads spawned by this process. If you mean to attach the running program of your code to attach to ... something else (to what?) then you need a programatical solution as pointed out in the other responses.

          Pranit Kothari wrote:

          I highly appropriate

          I think you mean 'appreciate' ;)

          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