title: C# WPF Animate Minimize/Maximize/Restore custom Window (WindowStyle.None && AllowsTransparency = true)
body: <p>As my title says, I need to animate this kind of window. I actually capture the WM_SYSCOMMAND and define the specific WindowState.</p>
  <h3>CodeSnippet:</h3>
  <pre><code>    private System.IntPtr WindowProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam,ref bool handled)
      {
          var retVal = IntPtr.Zero;
  
          switch (msg) //http://www.mycsharp.de/wbb2/thread.php?postid=111901 Auflistung der WndProc-Message-Kommandos 
          {           
              case 0x0112: //https://msdn.microsoft.com/de-de/library/windows/desktop/ms646360(v=vs.85).aspx //WM_SYSCOMMAND message
                  if ((int)wParam == 0xF120) //SC_RESTORE | Restores the window to its normal position and size.
                  {
                      WindowState = WindowState.Normal;
                      handled = true;
                  }
                  else if ((int) wParam == 0xF030) //SC_MAXIMIZE | Maximizes the window.
                  {
                      WindowState = WindowState.Maximized;
                      handled = true;
                  }
                  else if ((int) wParam == 0xF020) //SC_MINIMIZE | Minimizes the window.
                  {
                      WindowState = WindowState.Minimized;
                      handled = true;
                  }
                  break;
          }
         
          return retVal;
      }
  </code></pre>
  <p>Should I manually make a storyboard and calculate the new size and direction? Or is there another way to solve my problem?</p>
  <p><em>Change the WindowStyle before WindowState is no solution, because of &quot;AllowsTransparency = true&quot;</em>.</p>
  <p>Regards</p>
  <h3>Edit:</h3>
  <p>I made a complete new style, that the app has always the same look (on every OS).</p>
  <p>Window activated:</p>
  <p><img src="https://i.imgur.com/Y7t5sA4.png" alt="Window activated" /></p>
  <p>Window deactivated:</p>
  <p><img src="https://i.imgur.com/IR3AExK.png" alt="Window deactivated" /></p>
  <p>Window Language:</p>
  <p><img src="https://i.imgur.com/cvfSOZA.png" alt="Window deactivated" /></p>
  <p>On the taskbar is a comboBox to switch the languages live. Is has also a fade in/out effect on open/close Window.</p>