private static void OnWindowHeightAnimationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     try
     {
         if (d is Window window)
         {
             IntPtr handle = new WindowInteropHelper(window).Handle;
             if (WinAPIWrapper.GetWindowRect(handle, out RECT rect))
             {
                 if (PresentationSource.FromVisual(window) != null)
                 {
                     int height = (int)Math.Round(window.PointToScreen(new Point(0, (double)e.NewValue)).Y - rect.top);
                     WinAPIWrapper.SetWindowPos(handle, new IntPtr((int)SpecialWindowHandles.TopMost), rect.left, rect.top, rect.right - rect.left, height, SetWindowPosFlags.SHOWWINDOW);
                 }
             }
         }
     }
     catch (Exception)
     {
     }
 }