473,406 Members | 2,467 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,406 software developers and data experts.

Check if instance of exe is running already

What is the C# command/function for checking to see if another instance of
the application is already running?
Mar 20 '07 #1
4 6460
On Tue, 20 Mar 2007 11:45:05 -0700, Rob wrote:
What is the C# command/function for checking to see if another instance of
the application is already running?
Read this link for ideas

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

--
Bits.Bytes
http://bytes.thinkersroom.com
Mar 20 '07 #2
Rob,

I assume you are looking to only have one instance of your app running
at the same time. In order to do this, check out a previous response to
this question:

http://groups.google.com/group/micro...128f9ddd957ada

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rob" <Ro*@discussions.microsoft.comwrote in message
news:B5**********************************@microsof t.com...
What is the C# command/function for checking to see if another instance of
the application is already running?

Mar 20 '07 #3
Rob <Ro*@discussions.microsoft.comwrote:
What is the C# command/function for checking to see if another instance of
the application is already running?
See http://pobox.com/~skeet/csharp/faq/#...ation.instance

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 20 '07 #4
"Rob" <Ro*@discussions.microsoft.comwrote in message
news:B5**********************************@microsof t.com...
What is the C# command/function for checking to see if another instance of
the application is already running?

Use a mutex like this:

...
bool firstInstance;
using (Mutex AppMutex = new Mutex(true, new
Guid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").ToString(), out firstInstance))
{
if (firstInstance== true)
{
// run your code from here
}
} // mutex released here.
...
Willy.

Mar 20 '07 #5

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

Similar topics

3
by: Roger | last post by:
How can I check if a field already exist in a table? If it doesn't exist I want to add it with ALTER TABLE ADD...
3
by: Deasun | last post by:
Good morning In vb.net how would one go about checking if the app is already running Need some pointers on this Thank Deasun
3
by: Mike Thomas | last post by:
In Access 2000, Win NT, Citrix, we have each user opening the front end mdb in their own folder, and linnking to the back end. I've noticed that a user can get more than one instance open at a...
2
by: maccaroo | last post by:
Hello, Is it possible to find out if the current code if executing in the full version of Access or if it is using a runtime? We have a number of roaming users running a mixture of versions,...
9
by: KelsMckin | last post by:
Hello, I was wondering if there was a way to check there was already a form open before opening a new one, sorry that doesnt seem clear, here is an example: The following button opens a new form...
3
by: byeung | last post by:
Hi, I am trying to check if a particular record already exists in an Access database through Excel vba code. Through code obtained at another forum, I got the following: ...
4
by: Simon Gare | last post by:
Hi all, below is an insert statement on an asp page that stores the date and time that a driver logged on, what I need is to check that they are now already logged on fields are SQL Server...
3
by: Rudi | last post by:
Hello, following problem: At program end or release an assembly a serial device should get a final exit sequence. How can I do this? With Dispose() it's no problem, but this assembly is used...
5
by: ashurack | last post by:
I found a stored procedure online a while back and want to inplement it. The only problem is that it doesn't check to see if the number generated is currently in use in the DB. I know it's really...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.