在第二台显示器上打开程序

时间:2014-11-22 07:23:28

标签: c# multiple-monitors

我使用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)应用程序)

它已成功移入第二个监视器。但经过最小化和最大化后,窗口会转回主监视器。

0 个答案:

没有答案