Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an application that starts some other applications all communicating between them. In developing phase some apps could and do get hanged, so you have to manually close everything.(End Task,End Task,End Task...) So far everyone in developing is using end task for each, and now I have to write a sniffer to know which app was started by which app in order to close the processes with certain id. So the question:

How can I see which process started which ? All i want is a pid. I am now at the point where I get processes only for the current user without the ones from the SYSTEM, NETWORK or LOCAL.(I used the dll import method to get current process username- it's the fastest so far) I need this because if a developer has the main app opened twice I don't know which app started the "second" process.
I am working in c#.
Posted

1 solution

Have a look at this: under answers, look for 24 and check the code for GetParentProcess(IntPtr handle)
http://stackoverflow.com/questions/394816/how-to-get-parent-process-in-net-in-managed-way[^]
The Parent process should be the one you are looking for - with a bit of luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900