110,538
社区成员
发帖
与我相关
我的任务
分享
private void LoadThirdProess(string ThirdProessFilePath)
{
skinPanel1.Controls.Clear();
Process p = new Process();
p.StartInfo.FileName = ThirdProessFilePath;
p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;//加上这句效果更好
p.Start();
System.Threading.Thread.Sleep(1000);//加上,100如果效果没有就继续加大
MaiPtr = p.MainWindowHandle;
SetParent(p.MainWindowHandle, skinPanel1.Handle); //panel1.Handle为要显示外部程序的容器
MoveWindow(p.MainWindowHandle, 0, 0, skinPanel1.Width, skinPanel1.Height, true);
}
Task.Run(()=> { LoadAutoMesureWateP(); });//加载第三方程序
SetParent(p.MainWindowHandle, skinPanel1.Handle); //panel1.Handle为要显示外部程序的容器
这句测试通不过。