Previous Instance in .NET
Hi,
I wanted to know whether my exe is already running or not and based on that i need to take some action. If it is already running i need to call a button click event of the already running instance else invoke the application.
can any one please help me out in finding the previous instance.
Thanks in advance.
Vinoth
Re: Previous Instance in .NET
Quote:
Originally Posted by nvinoth123
Hi,
I wanted to know whether my exe is already running or not and based on that i need to take some action. If it is already running i need to call a button click event of the already running instance else invoke the application.
can any one please help me out in finding the previous instance.
Thanks in advance.
Vinoth
This has been addressed previously, and I think that you'll find satisfactory answers here:
https://forums.codeguru.com/showthread.php?t=365303
https://forums.codeguru.com/showthread.php?t=357536
https://forums.codeguru.com/showthread.php?t=345792
/Pete
Re: Previous Instance in .NET
You can write some thing like this:
// Get all instances of program running on the local
// computer.
Process [] xyz = Process.GetProcessesByName("xyz");