using System;
using System.Drawing;
using System.Runtime.InteropServices;
public static class DisplayFusionFunction
{
private enum ShowWindowEnum : uint
{
SW_HIDE = 0,
SW_SHOWNORMAL = 1,
SW_NORMAL = 1,
SW_SHOWMINIMIZED = 2,
SW_SHOWMAXIMIZED = 3,
SW_MAXIMIZE = 3,
SW_SHOWNOACTIVATE = 4,
SW_SHOW = 5,
SW_MINIMIZE = 6,
SW_SHOWMINNOACTIVE = 7,
SW_SHOWNA = 8,
SW_RESTORE = 9,
SW_SHOWDEFAULT = 10,
SW_FORCEMINIMIZE = 11,
SW_MAX = 11,
}
[DllImport("User32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool ShowWindow(IntPtr hWnd, ShowWindowEnum nCmdShow);
public static void Run(IntPtr windowHandle)
{
IntPtr hwnd = BFS.Window.GetWindowByText("Tabman");
if ((ulong)hwnd > 0)
{
if (BFS.Window.IsMinimized(hwnd))
{
BFS.Window.Restore(hwnd);
}
else // maybe an if goes here?
{
// Hide the window
ShowWindow(hwnd, ShowWindowEnum.SW_HIDE);
// Wait .10 seconds
BFS.General.ThreadWait(100);
// Show the window
ShowWindow(hwnd, ShowWindowEnum.SW_SHOW);
}
}
}
}