C#代码执行exe程序后,如何放到一个控件上显示?如panel 问题如标题,请看标题↑↑↑↑....... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 比如说我执行了一个名为123.exe的程序,然后如何把它放到一个容器控件里显示出来. [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); 谁可以解释一下这几行代码吗? 调用Windows API 的FindWindow和SetParent方法 [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);} FindWindow 通过窗口名称找到窗口句柄,再调用SetParent把找到的窗口和Panel控件句柄做为SetParent的参数 关于blob类型截取问题 如何程序实现word文档只读 winform的DataGridVieW数据更新速度问题 如何用sql 获得access 的表数目 怎么找一个zip文件里所有的.xml文件? 线程问题 c#中用指针实现链表(顶有分) C#里面使用指针,只有几行,帮忙看看! 怎么刷新页面 在C#中用拼音首字符序列来实现检索功能 - ... (200分要求)求助呀。。。。急。。。 " int64 " 和" int64? " 区别 C# 扫面文件时,窗口停住了(类似假死),如何解决
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);
谁可以解释一下这几行代码吗?
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);}
FindWindow 通过窗口名称找到窗口句柄,再调用SetParent把找到的窗口和Panel控件句柄做为SetParent的参数