I'm running an application's EXE using a Class Library from a Service. But what i'm attempting to do is hide the application EXE's Window. Here is my code:
In my Class Library's function:-
public class MyClassLibrary
{
public void MyFunction()
{
Process process = new Process();
process.StartInfo.FileName = "C:\Program Files (x86)\MyFolder\MyApp.exe";
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
}
}
And this is where i'm calling it from:
class MyClass : ServiceBase
{
...
...
...
protected override void OnStart()
{
MyClassLibrary obj = new MyClassLibrary();
obj.MyFunction();
}
}
Despite all of the above, the window is yet seen. Can anyone please suggest a solution?
Thanks and Regards, Siddhant