Solved

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

Posted on 2004-08-29
5
3,035 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

685 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