110,539
社区成员
发帖
与我相关
我的任务
分享
namespace TestC
{
public partial class Form1 : Form
{
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "MoveWindow")]
public static extern bool MoveWindow(System.IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();//新建进程
p.StartInfo.FileName = "C:\\Program Files\\Internet Explorer\\iexplore.exe";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal ;
p.StartInfo.Arguments = "www.163.com";//网页
p.Start();
p.WaitForInputIdle();
MoveWindow(p.MainWindowHandle, 200, 300, 500, 200, true);
}
}
}