Solved

Get the "Running Program List" in C# Compact Framework

Posted on 2004-08-29
5
3,004 Views
Last Modified: 2012-08-13
Within a C# application running on a Pocket PC -- I would like to get a listing of the currently running applications -- i.e., the same ones that show up in the "Runnig Program List" under the "Settings"->"Memory".

Just need to stick the results into arraylist or the like -- and look for a specific application name.  Then if it's not running -- need to launch the application.
0
Comment
Question by:LanceWLarsen
  • 2
5 Comments
 
LVL 4

Expert Comment

by:NTAC
ID: 11925827
Here is something that mihgt do what you want:

                  Process[] pArray = System.Diagnostics.Process.GetProcesses();

                  bool startProc = true;
                  foreach ( Process proc in pArray)
                  {
                        if( proc.ToString().equals(yourNameYouWantToCheck) )
                        {      
                              startProc = false;
                              break;
                        }

                  }
                  if( startProc )
                System.Diagnostics.Process.Start("c:\\yourFilename.exe");
0
 
LVL 4

Expert Comment

by:NTAC
ID: 11925829
The Process.GetProcesses() willl return a list of running procs.  Then you can check it from there, and if not found--it will start the application you want.  Good luck on your program.
0
 

Author Comment

by:LanceWLarsen
ID: 11938379
Hmm... tried that -- but seems as if the System.Diagnostics.Process method does not exist in the Compact Framework... ideas?  Is there an alternate way to access the processes in the Compact Famework?

Thanks tons...
0
 
LVL 7

Accepted Solution

by:
God_Ares earned 250 total points
ID: 11950169
I think you going to thank me for this one,...

http://69.93.124.180/opennetcf/forums/topic.asp?TOPIC_ID=1482

ever head of opennetcf? www.opennetcf.org it's a downloadable libary. I suggest you serious look at it,.. (soooo trying no to use caps,..)

with use of opennetcf.org the code submitted by NTAC + few mods = success


regards Floris Briolas
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question