private const uint SWP_NOMOVE = 2; [DllImport("user32.dll")] private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); private void button1_Click(object sender, System.EventArgs e) { Process p = new Process(); p.StartInfo.FileName = "iexplore"; p.StartInfo.Arguments = "http://www.labo-dotnet.com"; if (p.Start()) { IntPtr hWnd = p.MainWindowHandle; SetWindowPos(hWnd,IntPtr.Zero,0,0,800,600,SWP_NOMOVE); } else { MessageBox.Show("impossible de lancer le process"); } }
using System.Runtime.InteropServices; using System.Diagnostics;