我使用SetWindowPos
将窗口移动到第二个监视器。
以下是我的步骤:
ProcessStartInfo startInfo = new ProcessStartInfo(file.FullName);
startInfo.WindowStyle = ProcessWindowStyle.Maximized;
Process p = Process.Start(startInfo);
Rectangle screen = Screen.AllScreens[1].WorkingArea;
SetWindowPos(p.MainWindowHandle, IntPtr.Zero,
screen.Left, screen.Top, screen.Width, screen.Height, 0);
(文件是PlanarView(.pvs)应用程序)
它已成功移入第二个监视器。但经过最小化和最大化后,窗口会转回主监视器。