インターネットブラウザの2つのインスタンスを開く必要があり、各インスタンスはコンソールアプリから別のモニター(2つあります)で開きます。SetWindowPosメソッドを見つけましたが、それを使用する方法が見つかりません。私の場合、それは何もしません...
この方法を正しく使用する方法を教えてください...
これが私が使用しているコードです:
[DllImport("user32.dll")]
public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags);
public static void Launch()
{
Process process = new Process();
process.StartInfo.FileName = "iexplore.exe";
process.StartInfo.Arguments = "microsoft.com";
process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
process.Start();
Rectangle monitor = Screen.AllScreens[1].WorkingArea;
SetWindowPos(process.MainWindowHandle, 0, monitor.Left, monitor.Top, monitor.Width - 200, monitor.Height, 0);
}
ありがとうDavid