PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework getting running processes

Reply

getting running processes

 
Thread Tools Rate Thread
Old 06-03-2006, 06:15 PM   #1
=?Utf-8?B?Qk9QTUtS?=
Guest
 
Posts: n/a
Default getting running processes


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
  Reply With Quote
Old 06-03-2006, 06:35 PM   #2
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: getting running processes

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.

"BOPMKR" <BOPMKR@discussions.microsoft.com> wrote in message
news:91067587-18F6-454B-AAAA-B3B6F88D830E@microsoft.com...
> 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



  Reply With Quote
Old 06-03-2006, 06:50 PM   #3
=?Utf-8?B?Qk9QTUtS?=
Guest
 
Posts: n/a
Default Re: getting running processes

Thanks.

"Paul G. Tobey [eMVP]" wrote:

> 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.
>
> "BOPMKR" <BOPMKR@discussions.microsoft.com> wrote in message
> news:91067587-18F6-454B-AAAA-B3B6F88D830E@microsoft.com...
> > 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

>
>
>

  Reply With Quote
Old 06-03-2006, 11:58 PM   #4
=?Utf-8?B?Qk9QTUtS?=
Guest
 
Posts: n/a
Default Re: getting running processes

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

"Paul G. Tobey [eMVP]" wrote:

> 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.
>
> "BOPMKR" <BOPMKR@discussions.microsoft.com> wrote in message
> news:91067587-18F6-454B-AAAA-B3B6F88D830E@microsoft.com...
> > 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

>
>
>

  Reply With Quote
Old 07-03-2006, 03:17 PM   #5
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: getting running processes

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

Paul T.

"BOPMKR" <BOPMKR@discussions.microsoft.com> wrote in message
news8BF1F85-8DC7-4C84-9B52-7A6E2B28E1C3@microsoft.com...
> 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
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> 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.
>>
>> "BOPMKR" <BOPMKR@discussions.microsoft.com> wrote in message
>> news:91067587-18F6-454B-AAAA-B3B6F88D830E@microsoft.com...
>> > 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

>>
>>
>>



  Reply With Quote
Old 08-03-2006, 06:19 PM   #6
=?Utf-8?B?Qk9QTUtS?=
Guest
 
Posts: n/a
Default Re: getting running processes

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

"Paul G. Tobey [eMVP]" wrote:

> Answered in the separate thread which you created for some reason. There's
> a Kill() method, as a last resort.
>
> Paul T.
>
> "BOPMKR" <BOPMKR@discussions.microsoft.com> wrote in message
> news8BF1F85-8DC7-4C84-9B52-7A6E2B28E1C3@microsoft.com...
> > 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
> >
> > "Paul G. Tobey [eMVP]" wrote:
> >
> >> 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.
> >>
> >> "BOPMKR" <BOPMKR@discussions.microsoft.com> wrote in message
> >> news:91067587-18F6-454B-AAAA-B3B6F88D830E@microsoft.com...
> >> > 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
> >>
> >>
> >>

>
>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off