-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restore Launcher Window Animations (#2031)
* Restoring Window Animations Code for restoring the window animations * Refactored window animation enable code to WindowsApi.cs --------- Co-authored-by: Measurity <[email protected]>
- Loading branch information
1 parent
54d4043
commit 03a221b
Showing
4 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using NitroxModel.Platforms.OS.Windows.Internal; | ||
|
||
namespace NitroxModel.Platforms.OS.Windows; | ||
|
||
public class WindowsApi | ||
{ | ||
public static void EnableDefaultWindowAnimations(IntPtr hWnd, int nIndex = -16) | ||
{ | ||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) | ||
{ | ||
IntPtr dwNewLong = new((long)(Win32Native.WS.WS_CAPTION | Win32Native.WS.WS_CLIPCHILDREN | Win32Native.WS.WS_MINIMIZEBOX | Win32Native.WS.WS_MAXIMIZEBOX | Win32Native.WS.WS_SYSMENU | Win32Native.WS.WS_SIZEBOX)); | ||
HandleRef handle = new(null, hWnd); | ||
switch (IntPtr.Size) | ||
{ | ||
case 8: | ||
Win32Native.SetWindowLongPtr64(handle, nIndex, dwNewLong); | ||
break; | ||
default: | ||
Win32Native.SetWindowLong32(handle, nIndex, dwNewLong.ToInt32()); | ||
break; | ||
} | ||
} | ||
} | ||
} |