Single Instance

  • Thread starter Thread starter Pepi Tonas
  • Start date Start date
P

Pepi Tonas

Hi there,

I am looking for a way to prevent my application from starting again
if it is already running. Is there a way I can ask Windows if it is?

Thanx....
 
Get a list of processes from System.Diagnostics.Process and see if the app
is running.

-CJ
 
Every time I see this question, I think to myself... What if the application
is running under Terminal Server AND you want it to be once per Logged In
User session instead of once per machine...

What is the best way to do this?
 
Jim Hughes said:
Every time I see this question, I think to myself... What if the application
is running under Terminal Server AND you want it to be once per Logged In
User session instead of once per machine...

What is the best way to do this?

If it's easy to fetch the user's SID or domain and username, make
those part of the mutex name? What would be nice is if the same
set of techniques could be used to deal with both Terminal Server
and XP's fast user-switching, since the issues are similar. =)
 
Thanks for the reply - good ideas!

I thought about the XP - Fast User question right after I posted, but I'm
almost always in domain environments and not workgroups.

I also found this article after posting - while not specific to my question
it added relevant info to the subject!

http://www.codeproject.com/vb/net/sing_inistan.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top