1

I have an application that I am embedding into a form. That works fine, however, I would like to try to do it quietly (not visible).
I have tried using the property WindowStyle = ProcessWindowStyle.Minimized;, however it still showed up, not being 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);
            });
dwb
  • 475
  • 6
  • 31
  • Are you trying to use a Windows Forms app to launch another app in a 2nd process, and then hide the window of the 2nd process? If so, this answer may help: https://stackoverflow.com/a/739136/4415493 – JamesFaix May 23 '22 at 19:50
  • What do you mean by embed? For that matter, what do you mean by "a form" (a Windows Forms form?)? The common meaning of "embedding" in the Windows/Win32 world (where Windows Forms lives) is OLE 2.0 embedding - which isn't what you are describing at all. – Flydog57 May 23 '22 at 20:12
  • @Flydog57 - Sorry. I am embedding an application (notepad.exe for example) into a panel of a WinForm. – dwb May 23 '22 at 20:18

0 Answers0