diff --git a/Mag-Tools/PluginCore.cs b/Mag-Tools/PluginCore.cs index 24dc7c6..b351cea 100644 --- a/Mag-Tools/PluginCore.cs +++ b/Mag-Tools/PluginCore.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Drawing; using System.IO; @@ -1335,6 +1335,12 @@ public bool ProcessMTCommand(string mtCommand) return false; } + if (lower.StartsWith("/mt client ")) + { + if (lower == "/mt client minimize") + User32.ShowWindow(CoreManager.Current.Decal.Hwnd, User32.SW_MINIMIZE); + } + return false; } diff --git a/Shared/User32.cs b/Shared/User32.cs index 5d56fc5..cb483d9 100644 --- a/Shared/User32.cs +++ b/Shared/User32.cs @@ -70,5 +70,12 @@ public struct RECT /// If the function fails, the return value is zero. To get extended error information, call GetLastError. [DllImport("user32.dll", SetLastError = true)] public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int nWidth, int nHeight, bool bRepaint); + + + public const int SW_MINIMIZE = 6; + + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); } }