Hello,
I am writing an application using the .NET CF2. The purpose of this app is
to provide a means of starting and terminating a certain background process.
I can start the process using the process.start method. The problem is that I
have no way of knowing whether the process is already running. Is there a way
to find the process by the executable name? The GetProcessesByName method
does not exist in the compact framework. Is there a native code equivalent
that I can dll import? I have seen an app written in .NET that lists all
running process names and thier IDs, with the option to kill them, so I know
that it is possible. Alternatively, Is there a way to find the processes
message queue by name so that I could ping it, or send it a quit message?

Thanks
Jonathan King

Re: Find process by ctacke/>

ctacke/>
Sun Oct 22 22:05:36 CDT 2006

Do you have control over the target process code? If not the toolhelp APIs
will be what you want. We've got them wrapped in the SDF. IIRC you can get
a list of all processes in a list in the UI with 3 lines of code using it.
Killing the process is probably another 3 or so.

http://opennetcf.org/library/OpenNETCF.ToolHelp.ProcessEntryMembers.html


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--


"Jonathan King" <JonathanKing@discussions.microsoft.com> wrote in message
news:5E500044-EA01-4E08-AB9E-8FAE0724E177@microsoft.com...
> Hello,
> I am writing an application using the .NET CF2. The purpose of this app is
> to provide a means of starting and terminating a certain background
> process.
> I can start the process using the process.start method. The problem is
> that I
> have no way of knowing whether the process is already running. Is there a
> way
> to find the process by the executable name? The GetProcessesByName method
> does not exist in the compact framework. Is there a native code equivalent
> that I can dll import? I have seen an app written in .NET that lists all
> running process names and thier IDs, with the option to kill them, so I
> know
> that it is possible. Alternatively, Is there a way to find the processes
> message queue by name so that I could ping it, or send it a quit message?
>
> Thanks
> Jonathan King



Re: Find process by JonathanKing

JonathanKing
Mon Oct 23 08:22:02 CDT 2006

Thank you vey much. This has helped me greatly.

"<ctacke/>" wrote:

> Do you have control over the target process code? If not the toolhelp APIs
> will be what you want. We've got them wrapped in the SDF. IIRC you can get
> a list of all processes in a list in the UI with 3 lines of code using it.
> Killing the process is probably another 3 or so.
>
> http://opennetcf.org/library/OpenNETCF.ToolHelp.ProcessEntryMembers.html
>
>
> --
> Chris Tacke
> OpenNETCF Consulting
> Managed Code in the Embedded World
> www.opennetcf.com
> --
>
>
> "Jonathan King" <JonathanKing@discussions.microsoft.com> wrote in message
> news:5E500044-EA01-4E08-AB9E-8FAE0724E177@microsoft.com...
> > Hello,
> > I am writing an application using the .NET CF2. The purpose of this app is
> > to provide a means of starting and terminating a certain background
> > process.
> > I can start the process using the process.start method. The problem is
> > that I
> > have no way of knowing whether the process is already running. Is there a
> > way
> > to find the process by the executable name? The GetProcessesByName method
> > does not exist in the compact framework. Is there a native code equivalent
> > that I can dll import? I have seen an app written in .NET that lists all
> > running process names and thier IDs, with the option to kill them, so I
> > know
> > that it is possible. Alternatively, Is there a way to find the processes
> > message queue by name so that I could ping it, or send it a quit message?
> >
> > Thanks
> > Jonathan King
>
>
>