How to control the number of instances of a application
-
I want to control the number of instances of my application and if this number is greater than a fixed number, give the focus to one of the opened instances. Any suggestion?? Iván Fernández
-
I want to control the number of instances of my application and if this number is greater than a fixed number, give the focus to one of the opened instances. Any suggestion?? Iván Fernández
There is an article on Code Project by Detlef Grohs that describes the process for creating a single instance application in VB.NET. You could use the same technique with modifications to achieve what you want. It involves using Mutexes and .NET Remoting. The article is here: http://www.codeproject.com/vb/net/sing_inistan.asp[^] There is also a sample on MSDN called "Real World Applications" that describes a similar technique (using C#). It's located here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/reaworapps1.asp?_r=1[^]