473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

processes in xp

cs
is there an easy way to walk the process tree of winxp on .net? I dont mean
the regular stuff u can do on the process class, but things like end process
tree, or finding who is the parent of a process, etc. I am guessing its
easily doable calling system dlls?
Nov 16 '05 #1
3 2190
There is no concept of a Parent Process in Windows. At least, it's not
exposed. Certain programs like ProcessExp in SysInternals.com achieve this
by using Undocumented APIs - which is not recommended.

-vJ

"cs" <[rem]casolorz[rem]@hot[rem]mail.com> wrote in message
news:u2*************@TK2MSFTNGP09.phx.gbl...
is there an easy way to walk the process tree of winxp on .net? I dont mean the regular stuff u can do on the process class, but things like end process tree, or finding who is the parent of a process, etc. I am guessing its
easily doable calling system dlls?

Nov 16 '05 #2
Don't know where you get this from, but both statements are incorrect.
1)The Win32 API's CreateProcess, CreateProcessAsUser etc. do create Child
processes and as such the calling process is the parent of the child
process, right? (Just search MSDN for "parent process")
2) The Kernel32.dll API CreateToolhelp32Snapshot, can be used to take a
snapshot of all processes in the system, and
Process32First, Process32Next etc. can be used to walk the process chain,
they return a structure PROCESSENTRY32 that contains, amongst others, the
parentProcessId. And these API's are documented and exposed through the
toolhelp library, just take a look in the Platform SDK (MSDN).

Another [documented] way to walk the process hierarchy is to use
System.Management and the "win32_process class" WMI class.

Note: Sysinternals ProcessExp uses the toolhelp library function to walk the
process trees.

Willy.

"Vijaye Raji" <no************@hotmail.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
There is no concept of a Parent Process in Windows. At least, it's not
exposed. Certain programs like ProcessExp in SysInternals.com achieve
this
by using Undocumented APIs - which is not recommended.

-vJ

"cs" <[rem]casolorz[rem]@hot[rem]mail.com> wrote in message
news:u2*************@TK2MSFTNGP09.phx.gbl...
is there an easy way to walk the process tree of winxp on .net? I dont

mean
the regular stuff u can do on the process class, but things like en
tree, or finding who is the parent of a process, etc. I am guessing its
easily doable calling system dlls?


Nov 16 '05 #3
Yes, using System.Management and the WMI class Win32_Process, else you have
to PInvoke the Toolhelp API's.

Willy.

"cs" <[rem]casolorz[rem]@hot[rem]mail.com> wrote in message
news:u2*************@TK2MSFTNGP09.phx.gbl...
is there an easy way to walk the process tree of winxp on .net? I dont
mean
the regular stuff u can do on the process class, but things like end
process
tree, or finding who is the parent of a process, etc. I am guessing its
easily doable calling system dlls?

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Dirk Reske | last post by:
Hello, why doesn't this code work correctly? private int GetCpuUsage(Process proc) { DateTime time1,time2; TimeSpan timediff; double cpu1,cpu2,cpudiff;
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
4
by: AN | last post by:
Greetings, We make an ASP.NET web application and we host it for our customers. We have provisioned hardware and hope to be able to service around 200 customers on this hardware. The web...
35
by: Carl J. Van Arsdall | last post by:
Alright, based a on discussion on this mailing list, I've started to wonder, why use threads vs processes. So, If I have a system that has a large area of shared memory, which would be better? ...
1
by: jazon | last post by:
Let me start by saying this for an Operating Systems class. No, I don't expect the work to be done for me. The assignment is as follows: To be honest, I feel like a fish out of water, like...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.