title: winform in console application
body: <p>I have a console application which can also open winform under certain    conditions.Processing(its a database export utility) and be done either through form or commandline. but the form is always associated with command prompt. i mean when i close the console the form get closed as well.My requirement is that when form is launched , the command prompt is closed by itself without closing the form. </p>
  
  <pre><code>  [STAThread]
      public static void Main(string[] args)
      {
  
           if(hastolaunchform)
            {
                    Application.Run(new Form1());
             }
  
           else
             {
                         Console.WriteLine("started");
                          try
                          {
                              dataclass.extract();
                              console.writeline("finish");
                          }
                          catch (Exception e)
                          {
  
                              Console.WriteLine("An error occur");
                          }
               }
  
           }
  </code></pre>