I have built a C# voice application that needs to access my microphone for more than one client/server connection at the same time.
The library I'm using only allows my Microphone to be used with one connection at any one time.
Using my microphone on more than one client/server connection at the same time is what I'd like to do.
If I open multiple instances of the app I've built I can use the same Microphone with each app at the same time, resulting in using it on more than one connection.
Great.
But I'd rather not have 3 or 4 instances of my application filling up my desktop, so my thinking was to have a Parent winforms Application which shows child applications within it.
I came across this post How can I run another application within a panel of my C# program?
which seems to be what I was looking for, but...
If I use the example..
private void button1_Click(object sender, EventArgs e)
{
Process p = Process.Start("notepad.exe");
Thread.Sleep(500); // Allow the process to open it's window
SetParent(p.MainWindowHandle, panel1.Handle);
}
[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
}
Notepad does open up on my form in the panel I've told it to, as expected.
Where as if I change
Process p = Process.Start("notepad.exe");
to
Process p = Process.Start("C:\\Users\\me\\source\\repos\\MyApp\\bin\\Release\\MyApp.exe");
my app is opened as normal outside of my Parent form.
What is this novice missing?
Or am I going about things the wrong way and should be doing something else?