views:

19

answers:

1

I want to set the ProcessStartInfo values for the running process... I am not starting an external process.

For example, is there an attribute I can place on my Main method that tells Windows to start this executable with the following settings.

I am trying to find a way to start my console hidden or minimized. Yes I can minimize it after it starts, or I can have my process start another process but neither of those are satisfactory.

Thanks

A: 

This article and code sample may solve your problem. (Uses Win32 API from Main to find and hide the console window.)

If you Google for .NET Hide Console you'll find many other articles that use the same idea to hide the UI.

Paul Sasik
Yes I am already using that as a stop gap... the problem is the console has already *started* by the time you get to make the Win32 call... so you see it appear then minimize. I want it to start minimized.
Schneider
I think you have to start it externally in that case. e.g. from another process with that directive set. If you want it hidden you could use the same method as above but for a frame window (not console.)
Paul Sasik