public void ActivateWindow(IntPtr handle) { User32NativeMethods.SetForegroundWindow(handle); int style = User32NativeMethods.GetWindowLong(handle, InteropConstants.GWL_STYLE); if ((style & InteropConstants.WS_MINIMIZE) == InteropConstants.WS_MINIMIZE) { User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_RESTORE); } }
public void MaximizeWindow(IntPtr handle) { User32NativeMethods.ShowWindowAsync(handle, InteropConstants.SW_SHOWMAXIMIZED); }