Run console application minimized?

  • Thread starter Thread starter Derrick
  • Start date Start date
D

Derrick

Is there anywhere I can set a CSharp console application to run minimized?
Class attribute maybe? I looked thru the project properties and didn't see
anything.

Thanks in advance!

Derrick
 
Derrick,

I don't know that you can do that, at least, that you can minmize the
console window. Do you still want it to show up in the task bar or no?
 
Derrick said:
Is there anywhere I can set a CSharp console application to run minimized?
Class attribute maybe? I looked thru the project properties and didn't see
anything.
There are no such properties or attributes for any application types.
However, you can write an application which starts another application
without a visible window. The following code snippet does this:

System.Diagnostics.ProcessStartInfo process= new
System.Diagnostics.ProcessStartInfo(@"MyApplication.exe");
process.WindowStyle=System.Diagnostics.ProcessWindowStyle.Hidden;
process.UseShellExecute=false;
System.Diagnostics.Process.Start(process);

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
 
Back
Top