Skip to content

Commit

Permalink
Mag-Tools: add /mt client minimize
Browse files Browse the repository at this point in the history
  • Loading branch information
Mag-nus committed Oct 24, 2019
1 parent ad7d520 commit d57c734
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Mag-Tools/PluginCore.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
Expand Down Expand Up @@ -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;
}

Expand Down
7 changes: 7 additions & 0 deletions Shared/User32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,12 @@ public struct RECT
/// <para>If the function fails, the return value is zero. To get extended error information, call GetLastError.</para></returns>
[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);
}
}

0 comments on commit d57c734

Please sign in to comment.