Hosting EXE Application in a Winform?

C

coolCoder

Hi!
It's possible to Host a exe application in a winform?

Thanks

Hi Kevin,
Whether you want a new EXE to be started form your Form
or execute it inside your form.

If you want to just execute external EXE, then you can
always use the Process class.

Thanks,
coolCoder
 
E

erwin walvoort

Hello Kevin,
I also want to run an external application and show it in a windows .net
form. Unfortunally the link to codeproject doesn't work. Can you reply me the
article please or do you have an example for me ?

Thanks for that,

Erwin
 
F

Franck

using System.Threading;

private void Startnewformthread()
{
frmMyform frm = new frmMyform();
frm.Show();
//here do a loop while the form exist, just be sure to put a
DoEvents
//and a certain pause timer to not make it run 100000 times per
second
//for sleep use this : System.Threading.Thread.Sleep(1000);
//1000 = 1 second
}

somewhere in the code

Thread t = new Thread(new ThreadStart(Startnewformthread));
t.Start();
 
M

Martin Carpella

Hi,

Franck said:
using System.Threading;

private void Startnewformthread()
{
frmMyform frm = new frmMyform();
frm.Show();
//here do a loop while the form exist, just be sure to put a
DoEvents
//and a certain pause timer to not make it run 100000 times per
second
//for sleep use this : System.Threading.Thread.Sleep(1000);
//1000 = 1 second
}

somewhere in the code

Thread t = new Thread(new ThreadStart(Startnewformthread));
t.Start();

You shouldn't run your own message loop on a seperate thread. If you
want two or more independent message loops, use Application.Run(frm) on
the appropriate thread.

Also make sure to not access any control on another thread without an
appropriate call to Control.Invoke().

Best regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top