views:

66

answers:

1

I'm trying to create an application that adheres to the following:

  • No Taskbar
  • No console or form window
  • Can utilize Console.WriteLine(). (i.e. If someone executes the app from command prompt it will actually write to that console.)

The problem is if I create a Windows Form (or WPF) application I can have it so that there is no taskbar, console or window show up, but Console.WriteLine() does nothing. If I create a console app, it writes to the console, but I can't figure out how to hide it (and if I did hide it, would it write to the command prompt window?)...

How do I do this?

+1  A: 

Just create a standard console application. It is the callers responsibility to hide the window caused by the program (from http://stackoverflow.com/questions/836427/how-to-run-a-c-console-application-with-the-console-hidden ):

System.Diagnostics.ProcessStartInfo start =
      new System.Diagnostics.ProcessStartInfo();     
start.FileName = dir + @"\Myprocesstostart.exe";
start.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
Andreas Paulsson