Running .exe in windows form but it opens an external window
-
I'm trying to open openoffice/Libreoffice impress(simpress.exe) in my C# windows form. But it opens in its own window and there is no data on form. I want to integrate it in my form. This is my code:
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = @"C:\Program Files\LibreOffice 4.0\program\simpress.exe";
proc.UseShellExecute = true;
var process = Process.Start(proc);
Thread.Sleep(2000);
SetParent(process.MainWindowHandle, this.Handle);It open Libreoffice impress but not in my form. How can I integrate it with my form? Thanks!
-
I'm trying to open openoffice/Libreoffice impress(simpress.exe) in my C# windows form. But it opens in its own window and there is no data on form. I want to integrate it in my form. This is my code:
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = @"C:\Program Files\LibreOffice 4.0\program\simpress.exe";
proc.UseShellExecute = true;
var process = Process.Start(proc);
Thread.Sleep(2000);
SetParent(process.MainWindowHandle, this.Handle);It open Libreoffice impress but not in my form. How can I integrate it with my form? Thanks!
toms from newdelhi wrote:
It open Libreoffice impress but not in my form.
That is what the
Process.Start
method is designed for. I do not know if it is possible to open this within your form. You need to study the openoffice SDK to see what features it supports.Use the best guess
-
I'm trying to open openoffice/Libreoffice impress(simpress.exe) in my C# windows form. But it opens in its own window and there is no data on form. I want to integrate it in my form. This is my code:
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = @"C:\Program Files\LibreOffice 4.0\program\simpress.exe";
proc.UseShellExecute = true;
var process = Process.Start(proc);
Thread.Sleep(2000);
SetParent(process.MainWindowHandle, this.Handle);It open Libreoffice impress but not in my form. How can I integrate it with my form? Thanks!
toms from newdelhi wrote:
It open Libreoffice impress but not in my form.
How can I integrate it with my form?Because LibreOffice is still loading and building it's form when you call
SetParent
. Try to WaitForInputIdle[^] before changing the parent.Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
I'm trying to open openoffice/Libreoffice impress(simpress.exe) in my C# windows form. But it opens in its own window and there is no data on form. I want to integrate it in my form. This is my code:
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = @"C:\Program Files\LibreOffice 4.0\program\simpress.exe";
proc.UseShellExecute = true;
var process = Process.Start(proc);
Thread.Sleep(2000);
SetParent(process.MainWindowHandle, this.Handle);It open Libreoffice impress but not in my form. How can I integrate it with my form? Thanks!
I have no idea how you can integrate it with your forms. You cannot use
Process.Start
to integrate any form with you custom form. Try to find any Library control like OCX control so that they can be integrated with your forms. But try this one [^]. I hope this will help you.First and the Foremost: FIGHT TO WIN
-
I have no idea how you can integrate it with your forms. You cannot use
Process.Start
to integrate any form with you custom form. Try to find any Library control like OCX control so that they can be integrated with your forms. But try this one [^]. I hope this will help you.First and the Foremost: FIGHT TO WIN
Actually, you can. It takes a fair bit of interop work, but it is possible. Basically, you reparent the application into yours.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier -
Actually, you can. It takes a fair bit of interop work, but it is possible. Basically, you reparent the application into yours.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easierI thought that COM automation is used for these jobs. OpenOffice would/should have registered a COM automation object for external applications to call the automation server (dll). www.oooforum.org/forum/viewtopic.phtml?t=9815
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.
-
I thought that COM automation is used for these jobs. OpenOffice would/should have registered a COM automation object for external applications to call the automation server (dll). www.oooforum.org/forum/viewtopic.phtml?t=9815
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.
You could do it this way, but you can also reparent other application windows.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier -
You could do it this way, but you can also reparent other application windows.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier -
You could do it this way, but you can also reparent other application windows.
I was brought up to respect my elders. I don't respect many people nowadays.
CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easierActually I'm trying to integrate OpenOffice/LibreOffice in my C# windows form program. But I'm getting bootstrap error. So I thought to do it in this way. Is it not possible to integrate it in C# program. Do anyone having any idea of doing it? Please suggest.
-
toms from newdelhi wrote:
It open Libreoffice impress but not in my form.
How can I integrate it with my form?Because LibreOffice is still loading and building it's form when you call
SetParent
. Try to WaitForInputIdle[^] before changing the parent.Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
I used it but its not working. I used process.WaitForInputIdle() but getting the same result. Thanks!
-
Actually I'm trying to integrate OpenOffice/LibreOffice in my C# windows form program. But I'm getting bootstrap error. So I thought to do it in this way. Is it not possible to integrate it in C# program. Do anyone having any idea of doing it? Please suggest.
This seems to fit your problem even though it's MSOffice in the examples. officeautomationcsharp.php & this fits in too. Hosting-EXE-Applications-in-a-WinForm :)
"It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.
-
I'm trying to open openoffice/Libreoffice impress(simpress.exe) in my C# windows form. But it opens in its own window and there is no data on form. I want to integrate it in my form. This is my code:
ProcessStartInfo proc = new ProcessStartInfo();
proc.FileName = @"C:\Program Files\LibreOffice 4.0\program\simpress.exe";
proc.UseShellExecute = true;
var process = Process.Start(proc);
Thread.Sleep(2000);
SetParent(process.MainWindowHandle, this.Handle);It open Libreoffice impress but not in my form. How can I integrate it with my form? Thanks!
Check out referring Embedded Open Office assembly.
Vasudevan Deepak Kumar Personal Homepage
Tech Gossips
The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep!