悄悄地将应用程序嵌入到Windows窗体中

问题描述 投票:0回答:1

我有一个正在嵌入到表单中的应用程序。这很好用,但是,我想尝试安静地完成它(不可见)。
我尝试过使用属性

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);
            });
c#
1个回答
0
投票

您可以尝试使用该房产

MyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

© www.soinside.com 2019 - 2024. All rights reserved.