110,536
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("user32.dll", EntryPoint = "FindWindow")]
public static extern int FindWindow(
string lpClassName,
string lpWindowName
);
[DllImport("user32.dll", EntryPoint = "SetParent")]
public static extern int SetParent(
int hWndChild,
int hWndNewParent
);
private void Form1_Load(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("calc.exe");
System.Threading.Thread.Sleep(100);
SetParent(FindWindow("SciCalc", "计算器"), this.Handle.ToInt32());
}
}
}