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. Getting command line parameters of a running process

Getting command line parameters of a running process

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 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.
  • R Offline
    R Offline
    rocky_pulley
    wrote on last edited by
    #1

    I'm trying to get the command line parameters of a running process. Does anyone know how to do this? I know I can set a windows hook with WH_SHELL, but I would like to be able to do it on the fly instead of having my application started before the processes I'm trying to view. -- Rocky Dean Pulley

    _ D 2 Replies Last reply
    0
    • R rocky_pulley

      I'm trying to get the command line parameters of a running process. Does anyone know how to do this? I know I can set a windows hook with WH_SHELL, but I would like to be able to do it on the fly instead of having my application started before the processes I'm trying to view. -- Rocky Dean Pulley

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You could use the GetCommandLine API. Put this API in a function and run the function remotely using CreateRemoteThread. « Superman »

      R D 2 Replies Last reply
      0
      • _ _Superman_

        You could use the GetCommandLine API. Put this API in a function and run the function remotely using CreateRemoteThread. « Superman »

        R Offline
        R Offline
        rocky_pulley
        wrote on last edited by
        #3

        Thanks, that's what I'm about to try. I was hoping there was a way to do it without injecting anything but this will do I think. Thanks, -- Rocky -- Rocky Dean Pulley

        1 Reply Last reply
        0
        • R rocky_pulley

          I'm trying to get the command line parameters of a running process. Does anyone know how to do this? I know I can set a windows hook with WH_SHELL, but I would like to be able to do it on the fly instead of having my application started before the processes I'm trying to view. -- Rocky Dean Pulley

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

          rocky_pulley wrote: I'm trying to get the command line parameters of a running process. See here.


          "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

          1 Reply Last reply
          0
          • _ _Superman_

            You could use the GetCommandLine API. Put this API in a function and run the function remotely using CreateRemoteThread. « Superman »

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

            The fourth parameter to CreateRemoteThread() is the starting point of the new thread. How do you go about getting that starting point (i.e., function) into the other process?


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            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