title: Task bar progress bar does not show after window was hidden
body: <p>I am trying to add a progress bar to the taskbar icon in Windows 7 with C# (Net 3.5). I am using the Windows API Code Pack to achieve this:</p>
  
  <pre><code>    if (WindowStateInternal == FormWindowState.Normal) // the taskbar can only be set if the window is visible
      {
          TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Normal);
          TaskbarManager.Instance.SetProgressValue(100 - (int)PercentRemaining, 100);
      }
  </code></pre>
  
  <p>This works fine, but only the first time the window is displayed. The user has the option to minimize the windows which then will be removed, as a trayicon exists. If the window is displayed again, I can not turn on the progress bar again.</p>
  
  <p>Code run when user minimized window:</p>
  
  <pre><code>    this.WindowState = FormWindowState.Minimized;
      this.ShowInTaskbar = false;
      this.Visible = false; // otherwise problem when windows starts up and program is in autostart
      this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; // Hide from Task-List (Alt+Tab)
  </code></pre>
  
  <p>and when it is coming back to normal:</p>
  
  <pre><code>    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; // Show in Task-List (Alt+Tab)
      this.Visible = true;
      this.ShowInTaskbar = true;
      this.WindowState = FormWindowState.Normal;
      this.BringWindowToFront();
  </code></pre>
  
  <p>Turning off and on the progressbar does not work.</p>
  
  <p>How can I show the progressBar again?</p>