Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

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.
0
mbwatkins
Asked:
mbwatkins
1 Solution
 
ptakjaCommented:
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.
0
 
mbwatkinsAuthor Commented:
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.
0
 
armoghanCommented:
If you can not get the process, either using the Dotnet way or WIn32 way,
like explained in these articles
http://www.thecodeproject.com/vb/net/sing_inistan.asp
http://www.thecodeproject.com/vb/net/ActivateSingleAppInstance.asp

then there is no proper way..

What at the most you can do is
When ever your application starts, write it somewhere that an instance has started, on a file/registry may be..
I dont know if you can write in a shared memory area in Dotnet or not. If yes then that would be ideal and when ever the new application starts it should check from there, that if an instance is present or not.
and while closing the application it should be cleared
0
 
ahmadfuwadCommented:
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
0
 
mbwatkinsAuthor Commented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now