.exe
在我的winform中
给我的密码是
通过Greg Young先生
public class Native {
[DllImport("user32.dll", SetLastError = true)]
private static extern uint SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
public static void LoadProcessInControl(string _Process, Control _Control)
{
System.Diagnostics.Process p = System.Diagnostics.Process.Start(_Process);
p.WaitForInputIdle();
Native.SetParent(p.MainWindowHandle, _Control.Handle);
}
}
它会在哪里
public partial class Form1 : Form {
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
LoadProcessInControl("notepad.exe", this.splitContainer1.Panel1);
LoadProcessInControl("notepad.exe", this.splitContainer1.Panel2);
}
}
The name 'LoadProcessInControl' does not exist in the current context
在我的编程知识中,类的范围仍然是一个弱点,我希望能更好地理解它。
谢谢你的帮助