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

way to check if program is already running

TM
Is there any way to check if another instance of my program is running if a
user executes it ?

I would like to warn the user if the program is already running to prevent
multiple instances.

Thanks
--
Tony

Nov 20 '05 #1
4 4501
Hi,

You need to use a mutex

http://groups.google.com/groups?selm...TNGP09.phx.gbl
Ken

-------------------
"TM" <no********@nothing.com> wrote in message
news:Ob****************@TK2MSFTNGP12.phx.gbl...
Is there any way to check if another instance of my program is running if a user executes it ?

I would like to warn the user if the program is already running to prevent
multiple instances.

Thanks
--
Tony

Nov 20 '05 #2
Check out my Tips and Tricks page.

http://www.bobpowell.net/tipstricks.htm
--
Bob Powell
Visit the GDI+ FAQ for articles, tips, tricks and code.
http://www.bobpowell.net/gdiplus_faq.htm

Read my blog
http://bobpowelldotnet.blogspot.com


"TM" <no********@nothing.com> wrote in message
news:Ob****************@TK2MSFTNGP12.phx.gbl...
Is there any way to check if another instance of my program is running if a user executes it ?

I would like to warn the user if the program is already running to prevent
multiple instances.

Thanks
--
Tony

Nov 20 '05 #3
Cor
Hi Bob,

Ken did give a link to a answer from Tom using managed code.

When you give a link to a solution using an API, than you have to tell in my
opinion what is not good on the managed code soluction.

Cor
Nov 20 '05 #4
* "TM" <no********@nothing.com> scripsit:
Is there any way to check if another instance of my program is running if a
user executes it ?

I would like to warn the user if the program is already running to prevent
multiple instances.


http://www.mvps.org/dotnet/dotnet/code/application/
-> "Nur eine Instanz einer Anwendung zulassen"

Just ignore the German language text and have a look at the code.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet/>
Nov 20 '05 #5

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

Similar topics

2
by: Amrik Singh | last post by:
HI folks can anyone help a newbie here. I would like to know how I can check if my software is already running. So that if the user click s on the shortcut to start the progam again it maximises...
3
by: Fabio Pliger | last post by:
Hi, is it possibile, in python, to check for an already running instance of an application? My problem is that, if my program i running and the user relaunch it, i don't want to open a new...
6
by: Pierre-Yves | last post by:
Hello, I would like to prevent my perl program to be executed several times simultaneously (if the program is already running, I would like to display a message like "another instance of this...
22
by: edgrsprj | last post by:
PROPOSED EARTHQUAKE FORECASTING COMPUTER PROGRAM DEVELOPMENT EFFORT Posted July 11, 2005 My main earthquake forecasting Web page is: http://www.freewebz.com/eq-forecasting/Data.html ...
4
by: Nick Sinclair | last post by:
Hi all, I'm new to C. I have successfully written a small C program that acts as a "wrapper" around cgi scripts. These scripts perform admin tasks such as backing up etc. Obviously, The need...
3
by: Henry | last post by:
oHi, I want to check for a Windows form program if an instance of the prgram is already running: if yes the program's window should be activated and no second program instance should be started....
14
by: Alex K. | last post by:
Hi all I'd like to avoid starting the same c# application twice on the same computer. How do I check if it is already running? Thank you
1
by: keri | last post by:
Hi, I use the below for the user to view their outlook calendar Sub DisplayInbox() Dim myolApp As Outlook.Application Dim myNameSpace As Outlook.NameSpace Dim myFolder As Outlook.MAPIFolder...
1
by: =?Utf-8?B?WWFlbA==?= | last post by:
Hi, How can I check from C# code if outlook program if the process is already running? if not, I run outlook with: System.Diagnostics.Process.Start("OUTLOOK.EXE"); Thank you!
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: 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?
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
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
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...

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.