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




"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


.



Relevant Pages

  • Re: Word 2003 envelope dialog gone
    ... ToolsCreateEnvelope that is hijacking the built-in menu command. ... Microsoft MVP ... and the Labels tab shows the label set up options. ...
    (microsoft.public.word.docmanagement)
  • Re: Microsoft Office Ultimate 2007 WHY???
    ... I don't mean to sound nasty but if you were digging around for two hours looking for a command and you never tried the built-in Help files, ... Microsoft MVP - Publisher ... | familiar pull down menus to the new graphical ribbons without ...
    (microsoft.public.office.misc)
  • Re: Windows Explorer Details View - column options missing, presum
    ... I'm just double-checking because in my testing of manually deleting the column handlers, 'regsvr32 shell32.dll' did not fix the problem, but 'regsvr32 /i shell32.dll' did. ... Microsoft MVP [Windows XP Shell/User] ... I tried the command and it completed successfully, ...
    (microsoft.public.windowsxp.customize)
  • Re: Entering escape codes for printing in Word 2003
    ... Microsoft MVP ... tray for printing when creating a new document on a template. ... I think I know that you should use the Print field command, ie, and then ... I guess this also could be achieved via a macro, but can you do an AutoRun ...
    (microsoft.public.word.docmanagement)
  • Re: Delete records from form and tables (Third Post)
    ... Forms do not store data, ... If you do have cascading delete between your Orders table and OrdersDetails ... Allen Browne - Microsoft MVP. ... The delete command then deletes the record from both tables. ...
    (microsoft.public.access.forms)