Re: How to get the command line arguments of other running process



Thanks James



"James Brown" <not@home> wrote in message
news:quedncQwkswjTEDeRVnyjA@xxxxxxxxxxxx
>
> "Manu" <dinil_kv@xxxxxxxxxxx> wrote in message
> news:%23hWd8jWJGHA.2012@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi All,
> >
> > Any one can help me out, using c++ how to get the command line arguments
> > of
> > all the process which is running in the system.
> >
> > Thanks
> > Manu
> >
> >
>
> one way:
>
> 1. OpenProcess to get a process-handle
> 2. CreateRemoteThread to run the GetCommandLineA/W API in the remote
> process.
> 3. GetExitCodeThread to get the return-value from GetCommandLine
> 4. ReadProcessMemory on this memory-address to get the command-line
> 5. CloseHandle(s) appropriately
>
> You'll need to EnumProcesses if you want more than one process.
>
> James
>
> --
> Microsoft MVP - Windows SDK
> www.catch22.net




> Free Win32 Source and Tutorials
>
>


.