title: Keep thread waiting on windows form response?
body: <p>I have a windows forms application that runs two threads simultaneously, with the UI thread running in the task bar. The UI thread actually performs completely separate functionality from the other process, but in the case that a new user logs into the application, I need to pop up a setup window from the non-UI thread. </p>
  
  <p>Here is the code from my Program.cs:</p>
  
  <pre><code>static void Main()
      {
          ThreadStart start = new ThreadStart(Waiting.wait);
          Thread waiting = new Thread(start);
          waiting.Start();
          Application.EnableVisualStyles();
          Application.SetCompatibleTextRenderingDefault(true);
          Application.Run(TaskBarIcon.getInstance());
      }
  </code></pre>
  
  <p>Currently, before TaskBarIcon can fully instantiate, one configuration method must be finished running in the waiting thread. This is achieved by passing a lock back and forth. 
  I would like to have this set up menu pop up while the configuration method is processing, and have the method wait to complete until the setup menu is done running. However, unless I run the set up menu directly from the Application.Run() method, I cannot even get the menu to show up properly. </p>
  
  <p>I'm very new to C#....would be able to do this quickly in Java, but C# seems to do things differently.</p>
  
  <p>Any suggestions or solutions would be greatly appreciated!</p>
  
  <p>badPanda</p>