how to know when an application is running

  • Thread starter Thread starter Juan Manuel Alegría B.
  • Start date Start date
J

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.
 
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 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.
 
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
 

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