我有一个正在嵌入到表单中的应用程序。这很好用,但是,我想尝试安静地完成它(不可见)。
我尝试过使用属性
WindowStyle = ProcessWindowStyle.Minimized;
,但它仍然出现,没有被最小化。
this.BeginInvoke((Action)async delegate ()
{
Process p = Process.Start(svPath);
p.WaitForInputIdle();
await Task.Delay(5000);
SetParent(p.MainWindowHandle, panel2.Handle);
SetWindowLong(p.MainWindowHandle, GWL_STYLE, WS_VISIBLE);
MoveWindow(p.MainWindowHandle, 0, 0, panel2.Width, panel2.Height, true);
});
您可以尝试使用该房产
MyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;