问题如标题,请看标题↑↑↑↑.......

解决方案 »

  1.   

    比如说我执行了一个名为123.exe的程序,然后如何把它放到一个容器控件里显示出来.
      

  2.   

    [DllImport("user32.dll")]
    public static extern IntPtr FindWindow(string classname, string windowname);
    [DllImport("user32.dll")]
    public static extern IntPtr SetParent(IntPtr Child,IntPtr Parent);使用:
    IntPtr h = FindWindow(null,"資訊系統");
    SetParent(h,WorkPanel.Handle); 
    谁可以解释一下这几行代码吗?
      

  3.   

    调用Windows API 的FindWindow和SetParent方法
      

  4.   

    [DllImport("User32.dll ", EntryPoint = "SetParent")]
    private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
    [DllImport("user32.dll ", EntryPoint = "ShowWindow")]
    public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);  
    private void button1_Click(object sender, EventArgs e)
    {
      Process p = new Process();
      p.StartInfo.FileName = "";
      p.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized; p.Start();
      System.Threading.Thread.Sleep(100);
    SetParent(p.MainWindowHandle, this.Handle);
      ShowWindow(p.MainWindowHandle, 3);}
      

  5.   


    FindWindow 通过窗口名称找到窗口句柄,再调用SetParent把找到的窗口和Panel控件句柄做为SetParent的参数