getting running processes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to get running process on an iPaq 2490 using vb code through vs2005.

I was expecting something like

for i = 1 to totalProcesses

arrayProcess(i) = getProcessBy ID(i)

if arrayProcess(i).startinfo.processName = "Terminal Services Client" then

msgBox("Bingo")

end if
next

Of course this doesn't work, but how can I achieve the desired effect.

Thanks in advance
 
There's a toolhelp wrapper in OpenNETCF that will allow you to enumerate
processes. The process name won't be something as clear as that, of course,
but you can check the EXE name. The namespace is OpenNETCF.ToolHelp.
You'll call ProcessEntry.GetProcesses(), and then loop through the array of
items that it creates for you.

Paul T.
 
Thanks.

Paul G. Tobey said:
There's a toolhelp wrapper in OpenNETCF that will allow you to enumerate
processes. The process name won't be something as clear as that, of course,
but you can check the EXE name. The namespace is OpenNETCF.ToolHelp.
You'll call ProcessEntry.GetProcesses(), and then loop through the array of
items that it creates for you.

Paul T.
 
OK I found the process ("mstsc40.exe") now how do I kill it? -which will help
me to initialize to a known state?

Thanks in advance
Bryan
 
Answered in the separate thread which you created for some reason. There's
a Kill() method, as a last resort.

Paul T.
 
Sorry I thought that because it was actually another question it would be
ignored here because this dealt with locating the process. I'll be more
careful in future.

Thanks for responding
 
Back
Top