I need to allow single instance of my process.
I did found the other System.Diagnostics.Process as follow:
System.Diagnostics.Process currentProcess =
System.Diagnostics.Process.GetCurrentProcess();
// Get all instances of GciViewer running on the local machin.
System.Diagnostics.Process[] localByName =
System.Diagnostics.Process.GetProcessesByName("Gci Viewer");
foreach( System.Diagnostics.Process process in localByName )
{
if( currentProcess.Id != process.Id )
{
// TO DO: How to set the focus to the process !!
}
}
How can I set focus to other process?
--
Thanks
Sharon