Click here to Skip to main content
15,912,897 members
Home / Discussions / C#
   

C#

 
QuestionHow to embed a .exe file in c# windows application Pin
r_jaz2-May-07 4:26
r_jaz2-May-07 4:26 
AnswerRe: How to embed a .exe file in c# windows application Pin
Dave Kreskowiak2-May-07 4:58
mveDave Kreskowiak2-May-07 4:58 
GeneralRe: How to embed a .exe file in c# windows application Pin
Giorgi Dalakishvili2-May-07 7:04
mentorGiorgi Dalakishvili2-May-07 7:04 
GeneralRe: How to embed a .exe file in c# windows application Pin
Dave Kreskowiak2-May-07 7:08
mveDave Kreskowiak2-May-07 7:08 
GeneralRe: How to embed a .exe file in c# windows application Pin
r_jaz2-May-07 7:44
r_jaz2-May-07 7:44 
GeneralRe: How to embed a .exe file in c# windows application Pin
Dave Kreskowiak2-May-07 8:12
mveDave Kreskowiak2-May-07 8:12 
GeneralRe: How to embed a .exe file in c# windows application Pin
r_jaz2-May-07 8:20
r_jaz2-May-07 8:20 
GeneralRe: How to embed a .exe file in c# windows application Pin
Dave Kreskowiak2-May-07 9:09
mveDave Kreskowiak2-May-07 9:09 
Somehow, I just knew there was no good reason behind this...

If you launch the .EXE using the Process class, you can easily get the window handle of the .EXE. Keep in mind, I have no idea if this is going to work for your ShockWave EXE! This code assumes there is a Panel control on your form called myPanel.
// This sets up the P/Invoke to make a call to an external library, like Win32
[DllImport("user32.dll"), EntryPoint = "SetParent", SetLastError = true)]
private static extern IntPtr SetParent(IntPtr hwndChild, IntPtr hwndParent);
 
 
    ...
    // Launch the .EXE...
    Process p = Process.Start("MyShockwave.EXE");
 
    // Wait for the .EXE to create its window and start looking for input
    p.WaitForInputIdle();
 
    // Assign the main window of the .EXE a new parent window
    SetParent(p.MainWindowHandle, myPanel.Handle);
    ...



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: How to embed a .exe file in c# windows application [modified] Pin
AFSEKI7-May-07 6:19
AFSEKI7-May-07 6:19 
GeneralRe: How to embed a .exe file in c# windows application Pin
Dave Kreskowiak7-May-07 13:01
mveDave Kreskowiak7-May-07 13:01 
QuestionAdding Checkbox to List view Pin
satyam1432-May-07 3:40
satyam1432-May-07 3:40 
AnswerRe: Adding Checkbox to List view [modified] Pin
Tarakeshwar Reddy2-May-07 3:41
professionalTarakeshwar Reddy2-May-07 3:41 
GeneralRe: Adding Checkbox to List view Pin
satyam1432-May-07 3:47
satyam1432-May-07 3:47 
GeneralRe: Adding Checkbox to List view Pin
AFSEKI7-May-07 6:26
AFSEKI7-May-07 6:26 
QuestionInstallation program for multiple applications? Pin
Fredand132-May-07 3:38
Fredand132-May-07 3:38 
AnswerRe: Installation program for multiple applications? Pin
LongRange.Shooter2-May-07 4:59
LongRange.Shooter2-May-07 4:59 
QuestionGenerics Pin
Malcolm Smart2-May-07 3:21
Malcolm Smart2-May-07 3:21 
AnswerRe: Generics Pin
PIEBALDconsult2-May-07 3:43
mvePIEBALDconsult2-May-07 3:43 
GeneralRe: Generics Pin
Malcolm Smart2-May-07 3:53
Malcolm Smart2-May-07 3:53 
GeneralRe: Generics Pin
Ian Shlasko2-May-07 4:43
Ian Shlasko2-May-07 4:43 
GeneralRe: Generics Pin
Malcolm Smart2-May-07 4:52
Malcolm Smart2-May-07 4:52 
QuestionExport SQL server database to access database file using c#.net Pin
Malayil alex2-May-07 2:49
Malayil alex2-May-07 2:49 
AnswerRe: Export SQL server database to access database file using c#.net Pin
J$2-May-07 10:22
J$2-May-07 10:22 
QuestionTime conversion Pin
Anka_Ame2-May-07 2:42
Anka_Ame2-May-07 2:42 
AnswerRe: Time conversion Pin
Luc Pattyn2-May-07 3:04
sitebuilderLuc Pattyn2-May-07 3:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.