AdvancedLauncher.SDK.Management.Windows.ApplicationWindowControl.OnLoaded C# (CSharp) Method

OnLoaded() private method

private OnLoaded ( object sender, System e ) : void
sender object
e System
return void
        private void OnLoaded(object sender, System.Windows.RoutedEventArgs e)
        {
            WindowsFormsHost FormsHost = new WindowsFormsHost();
            Panel = new System.Windows.Forms.Panel();
            FormsHost.Child = Panel;
            AddChild(FormsHost);
            this.Process = new Process();
            this.Process.StartInfo = StartInfo;
            this.Process.Exited += OnProcessExited;
            this.Process.Start();
            //this.Process.StartInfo.CreateNoWindow = true;
            this.Process.EnableRaisingEvents = true;
            this.Process.WaitForInputIdle();
            Thread.Sleep(WaitTimeout);
            NativeMethods.SetParent(Process.MainWindowHandle, Panel.Handle);

            // remove control box
            int style = NativeMethods.GetWindowLong(Process.MainWindowHandle, GWL_STYLE);
            style = style & ~WS_CAPTION & ~WS_THICKFRAME;
            NativeMethods.SetWindowLong(Process.MainWindowHandle, GWL_STYLE, style);

            // resize embedded application & refresh
            ResizeEmbeddedApp();
        }