how to open program through C# program and give this program focus
-
E_Gold wrote:
how to open program through C# program and give this program focus ?
You mean, you want to run one application. You can easily do it using Process.Start[^]Process.Start
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
-
E_Gold wrote:
how to open program through C# program and give this program focus ?
You mean, you want to run one application. You can easily do it using Process.Start[^]Process.Start
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.
and after starting it with Process.Start(), you can focus to it by pinvoking SetForegroundWindow(). For more info on SetForegroundWindow() http://msdn.microsoft.com/en-us/library/ms633539(VS.85).aspx[^]
-
Hope this part of code can help you. Process AgentIDEProcess = new Process(); AgentIDEProcess.StartInfo.FileName = "AgentIDE.exe"; string AgentIDEArgument = DirPath + " " + lwSpecFileName + " " + inputFileName + " " + outputFileName; // CurDir + " // + sourceId.ToString() + ".xml " + sourceId.ToString() + "input.xml " + sourceId.ToString() + "output.xml"; //AgentIDEArgument = AgentIDEArgument + " " + sourceId.ToString() + "eoptions.xml"; //AgentIDEArgument += " " + sourceId.ToString() + LWFile; Console.WriteLine("Arguments: " + AgentIDEArgument); AgentIDEProcess.StartInfo.Arguments = AgentIDEArgument; AgentIDEProcess.Start(); AgentIDEProcess.WaitForExit();