Does anyone know how to obtain a process id for a process running on an NT Server?
For a given process name, I want to obtain the associated process ID, such as that which you would find when you list running processes in Task Manager...
Let me rephrase the question: How do I enumerate all running processes on an NT server in order to obtain the data in the PROCESS_INFORMATION structure?
Solution 2 in the FAQ looks like what I am looking for. But... how do I make use of the CreateToolhelpSnapshot API call.. I doesn't seem to exist in kernal32...
I've just discovered that this is a Windows 2000 ONLY API call... and solution 1 in the FAQ won't work because I want to peer into MTS processes (mtx.exe). Any other suggestions?
answers most of this. They cheat and go through the perfmon objects (process counter) to get the info. You can get all kinds of process-releated info from the counter's instance data...
I have code that may help you. It checks to see if a certain program is running under NT and checks to see its CPU time. It cancels the job if the job stops responding. Email me if you need it.
brett_burnell@email.com
Brett Please visit my websites!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.