L
lovecreatesbea...
I want to start an IE instance within a Windows Form program, and put
the IE browser onto the secondary monitor.
But I got an exception at the following LINE 5 of the C# code when
called WaitForInputIdle on a process. Could you please help me out of
this trouble? Thank you.
private void button2_Click(object sender, EventArgs e)
{
Process p1 = new Process();
Process.Start("IExplore.exe", "www.google.com");
p1.WaitForInputIdle(2000); /LINE 5:
*System.InvalidOperationException */
IntPtr h1 = p1.MainWindowHandle;
Form f1 = (Form)Control.FromHandle(h1);
f1.DesktopLocation = Screen.AllScreens[0].Bounds.Location;
f1.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
f1.DesktopBounds = Screen.AllScreens[0].Bounds;
}
the IE browser onto the secondary monitor.
But I got an exception at the following LINE 5 of the C# code when
called WaitForInputIdle on a process. Could you please help me out of
this trouble? Thank you.
private void button2_Click(object sender, EventArgs e)
{
Process p1 = new Process();
Process.Start("IExplore.exe", "www.google.com");
p1.WaitForInputIdle(2000); /LINE 5:
*System.InvalidOperationException */
IntPtr h1 = p1.MainWindowHandle;
Form f1 = (Form)Control.FromHandle(h1);
f1.DesktopLocation = Screen.AllScreens[0].Bounds.Location;
f1.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
f1.DesktopBounds = Screen.AllScreens[0].Bounds;
}