title: JavaFX Minimizing & Maximing undecorated stage with animations
body: <p>I am using the accepted answer in this question: <a href="https://stackoverflow.com/questions/26972683/javafx-minimizing-undecorated-stage">JavaFX Minimizing Undecorated Stage</a> to minimize my app properly.</p>
  
  <p>However, unfortunately the default Windows minimize &amp; maximize <em>animations</em> are not shown at all (the window just appears and disappears).</p>
  
  <p>I know it is possible to make the animations display with undecorated windows, since I have one application that has this behavior (PotPlayer).</p>
  
  <p>How could I make the animations appear with JNA?</p>
  
  <p><strong>EDIT:</strong> Here's a working Kotlin code piece to minimize a JavaFX window properly, also added bounty.</p>
  
  <pre><code>fun makeMinimizable(stage: Stage) {
           val user32 = User32.INSTANCE
           val hWnd = user32.FindWindow(null, stage.title)
           val oldStyle = user32.GetWindowLong(hWnd, WinUser.GWL_STYLE)
           val newStyle = oldStyle or 0x00020000 // WS_MINIMIZEBOX
           user32.SetWindowLong(hWnd, WinUser.GWL_STYLE, newStyle)
      }
  </code></pre>