3

Is there a way to find processes by a PID? So let's say, i create a process, let's say cmd.exe with CreateProcess. From this cmd i open a notepad, and a paint. Is it possible to find those processes somehow? What i need is the PID from those processes.

Could someone please help me. It would be really important to me.

Thanks!

Nathan Kuchta
  • 13,482
  • 2
  • 26
  • 35
kampi
  • 2,362
  • 12
  • 52
  • 91

2 Answers2

1

You can find an example in the msdn microsoft windows api. check out this next link.

Enumerating All Processes

AminM
  • 1,658
  • 4
  • 32
  • 48
Remco
  • 1,713
  • 1
  • 13
  • 14
  • Thanks, for your help, but that's not quite what i want. If i start a process, like cmd, and from this cmd, i start other processes, then i want the pid's of these other processes. – kampi Nov 18 '12 at 00:57
  • It looks like you are trying to create your own shell of some kind. The CreateProcess call you mentioned contains a pointer to a PROCESS_INFORMATION structure of the newly created process, containing the PID. http://msdn.microsoft.com/en-us/library/windows/desktop/ms682512(v=vs.85).aspx. Good luck with it. – Remco Nov 18 '12 at 17:02
0

If you know the PID of the cmd, then I think you can use logic similar to the logic listed in this question to accomplish the task.

Community
  • 1
  • 1
antik
  • 5,282
  • 1
  • 34
  • 47