473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to limit app to one instance?

Ron
Hello,

Is there a property I can set in my vb.net project for
limiting the number of instances of the app to one? Like
if the app is already running, don't start another
instance if someone clicks on a shortcut or the exe
again. If there is not a property for this, what is the
code to achieve this?

Thanks,
Ron
Nov 21 '05 #1
4 1953
Glad to help - but this is a pretty commonly asked question ;-)

http://www.codeproject.com/csharp/re..._instances.asp

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Ron" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
Hello,

Is there a property I can set in my vb.net project for
limiting the number of instances of the app to one? Like
if the app is already running, don't start another
instance if someone clicks on a shortcut or the exe
again. If there is not a property for this, what is the
code to achieve this?

Thanks,
Ron

Nov 21 '05 #2
In the current version of Visual Studio, you have to write some code to do
this. See:

http://www.codeproject.com/vb/net/sing_inistan.asp
http://www.thescarms.com/dotNet/SingleInstance.asp
http://www.devhood.com/tutorials/tut...utorial_id=711

In Visual Studio 2005, there will just be a property you can set.

--
Scott Swigart
http://blog.swigartconsulting.com
"Ron" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
Hello,

Is there a property I can set in my vb.net project for
limiting the number of instances of the app to one? Like
if the app is already running, don't start another
instance if someone clicks on a shortcut or the exe
again. If there is not a property for this, what is the
code to achieve this?

Thanks,
Ron

Nov 21 '05 #3
Ron
Thanks all. That is exactly what I was looking for (even
the C# example - will eventually start migrating stuff
over that way).

Thanks again!

-----Original Message-----
Hello,

Is there a property I can set in my vb.net project for
limiting the number of instances of the app to one? Like
if the app is already running, don't start another
instance if someone clicks on a shortcut or the exe
again. If there is not a property for this, what is the
code to achieve this?

Thanks,
Ron
.

Nov 21 '05 #4
"Ron" <an*******@discussions.microsoft.com> schrieb:
Is there a property I can set in my vb.net project for
limiting the number of instances of the app to one? Like
if the app is already running, don't start another
instance if someone clicks on a shortcut or the exe
again. If there is not a property for this, what is the
code to achieve this?


How do I make sure that only one instance of my application runs at a time?
<URL:http://www.yoda.arachsys.com/csharp/faq/#one.application.instance>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alper AKCAYOZ | last post by:
Hello, I have developped an application used by Windows Forms (.NET) at Visual C++ ..NET v2003. I would like to limit my application to one instance working at a moment. More than one working...
27
by: ted benedict | last post by:
hi everybody, i hope this is the right place to discuss this weird behaviour. i am getting dynamically generated text or xml from the server side using xmlhttprequest. if the server side data is...
15
by: jane | last post by:
We are getting this error during a large large load. 2006-06-03-02.58.31.688266 Instance:sieinst Node:000 PID:1286274(db2agent (SRMW) 0) TID:1 Appid:GAFE423C.P4CE.0671B3070116 database...
3
by: sadanjan | last post by:
Hi , Appreciate if someone can clarify if database Share Memory Limit (2 GB ) in Unix 32 bit boxes is the top limit for all the databases put together in a database or is it for each of the...
2
by: D. Susman | last post by:
Hi, I know that this issue is indeed strictly operating system dependent but I am just curious: I have a five dimensional array, whose size sums to 68 MB (almost). This array is contained by...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.