title: Using C# FormWindowState to restore up?
body: <p>I'd like to detect if my application is minimized under certain situations, and if it is, the window needs to be restored.  I can do that easily as follows:</p>
  
  <pre><code>if(this.WindowState == FormWindowState.Minimized) {
      this.WindowState = FormWindowState.Normal;
  }
  </code></pre>
  
  <p>However, what happens if the user first maximizes the form, then minimizes it?  I don't know whether to set the <code>WindowState</code> to <code>FormWindowState.Normal</code> or <code>FormWindowState.Maximized</code>.  Is there a method or API call I can check to solve this problem?</p>