using System.Runtime.InteropServices;/*调用winapi*/
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll", SetLastError = true)]
private static extern long SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
void 嵌入可执行()
{
System.Diagnostics.Process 本地系统进程 = System.Diagnostics.Process.Start(System.Environment.CurrentDirectory + @"\FreeCell.exe");
while (FindWindow(null, "FreeCell") == IntPtr.Zero)
{
System.Threading.Thread.Sleep(100);
Application.DoEvents();
}
System.Threading.Thread.Sleep(1000);
SetParent(本地系统进程.MainWindowHandle, 五行农历容器.Handle);
}