469,613 Members | 1,294 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

How to find parent process' PID?

I know how to use Process.GetCurrentProcess to find out the PID of the
current application (vb.net) but I'd like to know the PARENT process PID
somehow. I've been looking at various methods including some of the WMI
stuff but inside VB.NET I'm still kind of confused about how to do it. Any
ideas?
Nov 21 '05 #1
1 11792
"coroto" <co****@discussions.microsoft.com> schrieb:
I know how to use Process.GetCurrentProcess to find out the PID of the
current application (vb.net) but I'd like to know the PARENT process PID
somehow. I've been looking at various methods including some of the WMI
stuff but inside VB.NET I'm still kind of confused about how to do it.
Any
ideas?


The .NET Framework AFAIK doesn't provide managed functionality to determine
a process' parent process ID.

PInvoke/Win32:

Functions 'CreateToolhelp32Snapshot', 'Process32First', 'Process32Next',
structure 'PROCESSENTRY32' has a member named 'th32ParentProcessID'.

Maybe some useful hints:

<URL:http://www.google.to/groups?q=dotnet+th32ParentProcessID+-herfried>

WMI:

'Win32_Process' has a property named 'ParentProcessId'. WMI can be accessed
using the "System.Management.dll" assembly.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Marius Kaizerman | last post: by
2 posts views Thread by gnutuxy | last post: by
4 posts views Thread by jewel87 | last post: by
2 posts views Thread by =?Utf-8?B?WVhR?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.