IntPtr hWnd = (IntPtr) p.MainWindowHandle.ToInt64();RECT rect = new RECT(new Point(500, 500), new Size(800, 600));GetWindowRect(hWnd, out rect);int width = rect.Right - rect.Left;int height = rect.Bottom - rect.Top;MoveWindow(hWnd, rect.Left, rect.Top, width, height, true);