Link to home
Start Free TrialLog in
Avatar of mbwatkins
mbwatkins

asked on

Keeping a form single instanced on pocket pc

I need to prevent multiple copies of the same form from being opened by a user.  This is easy to do with the full .NET framework (using the System.Diagnostics.Process object to get a list of running processes and looking for the apps name twice) but the mobile framework System.Diagnostics does not include the Process object.  

Anyone know of an easy way to get a list of processes on pocket pc or have an alternate solution?  Thanks for any help.
Avatar of ptakja
ptakja
Flag of United States of America image

Are you currently having this problem or are you expecting to have it? If an app is running on a PocketPC and you re-execute the application, the PockePC simply re-activates the app if it doesn't have focus.
Avatar of mbwatkins
mbwatkins

ASKER

I'm curretnly having this problem.  If I select the form from the programs list, a second instance of the form definitely starts as a second process.
ASKER CERTIFIED SOLUTION
Avatar of armoghan
armoghan
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
create a form instance in module as a public
public objname as new frmname()
then when you want to open a form just write
objname.show

this aproch will create form instance just a single time
The main problem was caused by debug mode.  You can open a second instance of the installed app behind a running debug instance.  The semaphore solution would've worked as well.