G
Guest
Hello, I am using VB.Net VS 2005. I have two Windows applications. The first
application has a command button with the following code that starts the 2nd
application.
Dim oStartInfo As ProcessStartInfo = New ProcessStartInfo
oStartInfo.FileName = "H:\RevTrak\RevTrak.exe"
Process.Start(oStartInfo)
This code works ok; however, there are two problems that I cannot resolve.
1. Each time the command button is clicked, another instance of the
executable program (RevTrak.exe) is started, which I do not want. I only want
one instance of the program to be running.
2. If the program is already running, I do not want to start another
instance of the program. I want the currently running program's window to get
focus (or to activate the window).
Thanks for your help.
application has a command button with the following code that starts the 2nd
application.
Dim oStartInfo As ProcessStartInfo = New ProcessStartInfo
oStartInfo.FileName = "H:\RevTrak\RevTrak.exe"
Process.Start(oStartInfo)
This code works ok; however, there are two problems that I cannot resolve.
1. Each time the command button is clicked, another instance of the
executable program (RevTrak.exe) is started, which I do not want. I only want
one instance of the program to be running.
2. If the program is already running, I do not want to start another
instance of the program. I want the currently running program's window to get
focus (or to activate the window).
Thanks for your help.