Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Checking Previous Instance (.NET Compact Framework 2.0) 1

Status
Not open for further replies.

zarkon4

MIS
Dec 16, 2003
641
US

I ran across the following code to check for a previous instance of my app running.

Private Function PrevInstance() As Boolean
If UBound(System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
Return True
Else
Return False
End If
End Function

Problem is that the GetProcessesByName is not available in
the compact framework.
I have a user that likes to hit the icon with the stylus twice (double-clicking so to speak) and two instances of it
then are running.
I am looking for a way to keep multiple instances from running.

Anyone have any ideas?
 
I thought the compact framework already handled it for you (i.e it only allowed a single instance)?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thats what I thought as well, but somehow the user is getting 2 instances.
 
I haven't done this in a while and I deleted my code that did just that since the second framework (or is this the third) does it all by itself. And I don't use the CF since I like the asp.net way better. But CF will always be troublesome. Still I can remeber the days we had 16Mb and run windows on it version 200BC.

Christiaan Baes
Belgium

"My new site" - Me
 
CF 2 is supposed to keep it from happening. I have been
playing with it and I can't seem to get multiple instances, but the user was getting them. I can't seem to duplicate it.
I think I'm chalking this up as a user malfunction.

Thanks everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top