public void ChangeWindowState(WndState state) { IntPtr fgWnd = WinAPIs.GetForegroundWindow(); WindowPlacement wp = new WindowPlacement(); WinAPIs.GetWindowPlacement(fgWnd, ref wp); WinAPIs.ShowWindowAsync(fgWnd, (int)state); }
public static extern bool GetWindowPlacement(IntPtr hWnd, ref WindowPlacement lpWndPlc);