getting running processes

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
 
P

Paul G. Tobey [eMVP]

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.
 
G

Guest

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.
 
G

Guest

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
 
P

Paul G. Tobey [eMVP]

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

Paul T.
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top