From ca7e94a306b4ec91ac94ffad9f63a515acd135eb Mon Sep 17 00:00:00 2001 From: ww-rm Date: Sat, 26 Apr 2025 15:23:50 +0800 Subject: [PATCH] update win32 --- SpineViewer/Natives/Win32.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/SpineViewer/Natives/Win32.cs b/SpineViewer/Natives/Win32.cs index 23c4388..e46d49b 100644 --- a/SpineViewer/Natives/Win32.cs +++ b/SpineViewer/Natives/Win32.cs @@ -57,8 +57,21 @@ namespace SpineViewer.Natives public const uint SMTO_NOTIMEOUTIFNOTHUNG = 0x0008; public const uint GA_PARENT = 1; + public const uint GW_OWNER = 4; + public const int SW_HIDE = 0; + public const int SW_SHOWNORMAL = 1; + public const int SW_SHOWMINIMIZED = 2; + public const int SW_SHOWMAXIMIZED = 3; + public const int SW_SHOWNOACTIVATE = 4; + public const int SW_SHOW = 5; + public const int SW_MINIMIZE = 6; + public const int SW_SHOWMINNOACTIVE = 7; + public const int SW_SHOWNA = 8; + public const int SW_RESTORE = 9; + public const int SW_SHOWDEFAULT = 10; + [StructLayout(LayoutKind.Sequential)] public struct POINT { @@ -89,6 +102,15 @@ namespace SpineViewer.Natives public uint dwTime; } + [StructLayout(LayoutKind.Sequential)] + public struct RECT + { + public int Left; + public int Top; + public int Right; + public int Bottom; + } + [DllImport("user32.dll", SetLastError = true)] public static extern nint GetDC(nint hWnd); @@ -140,6 +162,9 @@ namespace SpineViewer.Natives [DllImport("user32.dll", SetLastError = true)] public static extern nint GetWindow(nint hWnd, uint uCmd); + [DllImport("user32.dll", SetLastError = true)] + public static extern bool ShowWindow(nint hWnd, int nCmdShow); + [DllImport("gdi32.dll", SetLastError = true)] public static extern nint CreateCompatibleDC(nint hdc);