views:

401

answers:

2

Usually a mobile dev would not have to do this because the smart-minimise feature handles it.

But I need to do it myself because my mobile app is kicked off by a bootstrapper app.

The start menu icon kicks off the bottstrapper which downloads a target version from a web service, kicks it off and then closes. If the app gets minimised for whatever reason, the user would normally activate it again using the start menu icon. However, this kicks off the bootstrapper and results in a second copy of the client.

This question comes up everywhere on the net for desktop apps (and is in fact on this site). The usually cited solution is to use a combination of Process.GetProcessesByName combined with API calls to re-activate the process once found. Another solution is to create a controller class that inherits from some VisualBasic dll that I forget the name of. None of the solutions I have come across today are supported by the comapct framework.

So the actual question is a combination of:

Is there a compact framework alternative to Process.GetProcessesByName?

If not, what API call do I have to do instead?

+1  A: 

I'm not sure if you found this yet or not, but MSDN has an article on creating a process manager application that has the info that I think you need.

The article reccomends using toolhelp.dll and has a pretty detailed looking walk-through for getting a list of running processes. It's for Visual Studio 2003, so you should probably be good with whatever version of VS.NET you're running.

Mark
Hmm - not sure how I missed that! That looks like exactly what I need. Thanks
J M
The article posted above got me started and the following StackOverFlow question helped me tweak it as tbh the sample was sloppy in a few areas:http://stackoverflow.com/questions/393881/p-invoking-createtoolhelp32snapshot-failing-in-compact-frameworkThe answer from ctacke was very helpful!
J M
A: 

I want to restore my account on tagged. How i can do it?

Rozalina