embedding the matrix into the application form
Posted: 25 Oct 2011, 18:20
Hello everybody…
I have a c# application connected with BCI2000 by UDP channel, at the beginning of each run I open the bci2000 from the code by opening the .bat file.with this commends
after that i need to make th P3 Speller matrix appear in the same application form.
when i replace the "P3Speller.exe" with any other application (for example "notepad.exe" )the code able to open and embed the application to the form but in case of P3Speller.exe it open it out of the panel
i think the problem because P3Speller.exe open many windows not only one...
so i tried to access the sub-windows by searching for their names to use them but i could not get anything from the source code BCI2000src\src\core\Application\P3Speller
does any one have any idea how to get around this ?
thank you in advance
Thank you ………….
I have a c# application connected with BCI2000 by UDP channel, at the beginning of each run I open the bci2000 from the code by opening the .bat file.with this commends
Code: Select all
cd C:/BCI2000/prog
start operator.exe --OnConnect "-LOAD PARAMETERFILE C:\BCI2000\parms\examples\P3Speller_CopySpelling.prm; SETCONFIG"
start SignalGenerator.exe 127.0.0.1
start P3SignalProcessing.exe 127.0.0.1
Code: Select all
private void button1_Click_1(object sender, EventArgs e)
{
Process p = null;
IntPtr appWin = IntPtr.Zero; ;
try
{
Process.Start("C:\\BCI2000\\batch\\ttrryy.bat");
// Start the process
p = System.Diagnostics.Process.Start(@"C:\\BCI2000\\prog\\P3Speller.exe");
// Wait for process to be created and enter idle condition
p.WaitForInputIdle();
// Get the main handle
appWin = p.MainWindowHandle;
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, "Error");
}
// Put it into this form
SetParent(appWin, this.panel1.Handle);
// Remove border and whatnot
// SetWindowLong(appWin, GWL_STYLE, WS_VISIBLE);
// Move the window to overlay it on this window
MoveWindow(appWin, 0, 0, this .panel1.Width, this.panel1.Height, true);
}
.................
....................
..................
................
i think the problem because P3Speller.exe open many windows not only one...
so i tried to access the sub-windows by searching for their names to use them but i could not get anything from the source code BCI2000src\src\core\Application\P3Speller
does any one have any idea how to get around this ?
thank you in advance
Thank you ………….