Integrate the electronjs application inside the Wpf application with maximized window.

Nandini Nammi 41 Reputation points
2022-08-07T14:20:41.953+00:00

I am using the below code and able to load the exe but window is minimized

string exeName = AppDomain.CurrentDomain.BaseDirectory + "electronjs\SnapELMOS.exe";
var procInfo = new System.Diagnostics.ProcessStartInfo(exeName);
procInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(exeName);
procInfo.WindowStyle = ProcessWindowStyle.Maximized;
_childp = Process.Start(procInfo);
System.Windows.Forms.Panel _pnlSched = new System.Windows.Forms.Panel();
WindowsFormsHost windowsFormsHost1 = new WindowsFormsHost();
windowsFormsHost1.Child = _pnlSched;
electrongrid.Children.Add(windowsFormsHost1);
while (_childp.MainWindowHandle == IntPtr.Zero)
{
Thread.Yield();
}
_appWin = _childp.MainWindowHandle;
SetParent(_appWin, _pnlSched.Handle);
// dispatcherTimer.Stop();

could please help me what can i do for maximized window

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,368 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,671 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,235 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
762 questions
{count} votes