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. full path of a process

full path of a process

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
9 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.
  • Z Offline
    Z Offline
    zon_cpp
    wrote on last edited by
    #1

    Hi, how do i receive full path of a specified process with it's name. with Process32First and Process32Next functions, i will receive the name of specified process (the szExeFile member of PROCESSENTRY32 struct) but to have full path? please help me.

    Zo.Naderi-Iran

    CPalliniC 1 Reply Last reply
    0
    • Z zon_cpp

      Hi, how do i receive full path of a specified process with it's name. with Process32First and Process32Next functions, i will receive the name of specified process (the szExeFile member of PROCESSENTRY32 struct) but to have full path? please help me.

      Zo.Naderi-Iran

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      You may call GetModuleFilenameEx[^] (after calling OpenProcess[^] for retrieving process handle from process id). :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      Z 1 Reply Last reply
      0
      • CPalliniC CPallini

        You may call GetModuleFilenameEx[^] (after calling OpenProcess[^] for retrieving process handle from process id). :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        Z Offline
        Z Offline
        zon_cpp
        wrote on last edited by
        #3

        i include the psapi header:

        #include psapi.h

        but it is an error : unresolved externals ?

        Zo.Naderi-Iran

        modified on Thursday, December 9, 2010 6:39 AM

        CPalliniC 1 Reply Last reply
        0
        • Z zon_cpp

          i include the psapi header:

          #include psapi.h

          but it is an error : unresolved externals ?

          Zo.Naderi-Iran

          modified on Thursday, December 9, 2010 6:39 AM

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Did you link with Psapi.lib? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          In testa che avete, signor di Ceprano?

          Z 1 Reply Last reply
          0
          • CPalliniC CPallini

            Did you link with Psapi.lib? :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            Z Offline
            Z Offline
            zon_cpp
            wrote on last edited by
            #5

            no, only include psapi.h

            Zo.Naderi-Iran

            CPalliniC D 2 Replies Last reply
            0
            • Z zon_cpp

              no, only include psapi.h

              Zo.Naderi-Iran

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              The try to link with the library (select Project->Project Properties menu item, then, on the newly appeared window, choose Configuration Properties->Linker->Input, finally add Psapi.lib to the Additional Dependecies list). :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              In testa che avete, signor di Ceprano?

              Z 1 Reply Last reply
              0
              • CPalliniC CPallini

                The try to link with the library (select Project->Project Properties menu item, then, on the newly appeared window, choose Configuration Properties->Linker->Input, finally add Psapi.lib to the Additional Dependecies list). :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                Z Offline
                Z Offline
                zon_cpp
                wrote on last edited by
                #7

                it is ok, thank you

                Zo.Naderi-Iran

                CPalliniC 1 Reply Last reply
                0
                • Z zon_cpp

                  it is ok, thank you

                  Zo.Naderi-Iran

                  CPalliniC Offline
                  CPalliniC Offline
                  CPallini
                  wrote on last edited by
                  #8

                  You are welcome. :)

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  In testa che avete, signor di Ceprano?

                  1 Reply Last reply
                  0
                  • Z zon_cpp

                    no, only include psapi.h

                    Zo.Naderi-Iran

                    D Offline
                    D Offline
                    David Crow
                    wrote on last edited by
                    #9

                    Including a header file and linking with a library are two separate things.

                    "One man's wage rise is another man's price increase." - Harold Wilson

                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                    "Man who follows car will be exhausted." - Confucius

                    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