WPF: How to merge windows across processes

44 views Asked by At

I'm currently working on a feature in my WPF app, which allows the user to launch an external program. But I've got a problem.

// Here's a C# method, which handling the "open notepad" button click event
void OpenNotepad(object sender, RoutedEventArgs e)
{
    System.Diagnostics.Process p = new System.Diagnostics.Process();
    p.StartInfo.FileName = "C:\\Windows\\System32\\notepad.exe";
    p.StartInfo.UseShellExecute = false;
    p.Start();
}

By default, the Windows' taskbar handles "my WPF application window" and the "Notepad window" like this
enter image description here
But I would like to merge these two windows (maybe this is not the most accurate expression), but how can I improve my code?
enter image description here\

Any help is appreciated.

0

There are 0 answers