473,379 Members | 1,355 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,379 software developers and data experts.

how to know when an application is running

Hi, I need to know if an application is running because I want just one
instance of this application. So I'll execute it only if it is not running.

Thanks so much.
Nov 21 '05 #1
4 2658
Juan,

Please do not multipost, there are two of the standard answers on this (one
from me) in the newsgroup microsoft.public.dotnet.general

Cor

"Juan Manuel Alegrķa B."
..
Hi, I need to know if an application is running because I want just one
instance of this application. So I'll execute it only if it is not
running.

Thanks so much.

Nov 21 '05 #2
Nak
Hi there,

You can do this using a mutex,

http://www.freevbcode.com/ShowCode.asp?ID=5845

If you want to pass information from the second instance to the first
instance then your getting into a whole new ball park. You can do this by,

a) Firing your own custom windows messages
b) Using .NET remoting (my preferred method)
c) Using DDE

For information on making a single instance application that uses .NET
remoting to fire messages between the instances, refer to,

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

Hope this helps.

Nick.

"Juan Manuel Alegrķa B." <jm*********@hotmail.com> wrote in message
news:ef**************@TK2MSFTNGP09.phx.gbl...
Hi, I need to know if an application is running because I want just one
instance of this application. So I'll execute it only if it is not
running.

Thanks so much.

Nov 21 '05 #3
"Juan Manuel Alegrķa B." <jm*********@hotmail.com> schrieb:
Hi, I need to know if an application is running because I want just one
instance of this application. So I'll execute it only if it is not

running.

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>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #4
Nice GC details in that tip Herfried ...thank you.

btw: if the app has a GUI then you might want to bring it back to the top of
the ZOrder or back from the taskbar if it's minimized. For that, this link
might be helpful:

http://www.smithvoice.com/netinstance.htm

Robert Smith
Kirkland, WA

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eA****************@TK2MSFTNGP09.phx.gbl...
snip> --
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #5

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

Similar topics

8
by: middletree | last post by:
When I do a query that I know has 2 rows, I get rs.recordcount equals -1. Same thing when it's just one row. I need something that gives me the number of rows.
2
by: Juan Manuel Alegrķa B. | last post by:
Hi, I need to know if an application is running because I want just one instance of this application. So I'll execute it only if it is not running. Thanks so much.
1
by: Darren Jensen | last post by:
Hi, I have a machine which is running Windows Server 2003, IIS and .NET V1.1. I have been using this machine very well for about 6 months now for running ASP.NET on IIS and the occasional .NET...
1
by: Michael | last post by:
I am running a web server (IIS) on Windows 2003 SP 1. My ASP.NET C# applications run fine. However, my application is a combination of Classic ASP and C#. For some reason when you attempt to...
6
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal...
4
by: Rob Richardson | last post by:
Greetings! I am working on an application that targets a Pocket PC running Windows CE and SQL Server CE. Almost all functions in the application use a Try block with a Catch block that looks...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
0
by: Uma | last post by:
Dear all, I have a problem while running a smart client application which was installed through CD-ROM. After installing the smart client setup the application is running properly. When running...
22
by: robertgregson | last post by:
Using C#, .NET3.5, Visual Studio 2008 and WCF on Windows VISTA SP1, I have written a service, service host (as a C# console application) and a client. The service uses...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.