October 29th, 2003, 12:41 PM
How to run one executable inside another's client window space?
Is it possible to run an application inside another application's window space?
For example, if I have fred.exe and I want to have it appear to run as a child window of wilma.exe, an MDI app, is this possible?
One caveat - I write wilma.exe, but fred.exe is someone else's app and I can't modify it.
What I'm trying to do is host another application's instance inside my application.
October 29th, 2003, 12:57 PM
Wilma is going to be picky about what kind of app fred is...
If Fred is a console app, it should be fairly easy for wilma to use a pipe to capture the output from fred and display it in her own (console)window.. This is afterall a bit like how MSDev displays the output of the compiler/linker.
If Fred is a GUI program, then it's still somewhat possible, although it'll require LOTS of work, since you'll have to trap all window creation and window messages, and pass them along from wilma to fred. Only recommended for ultra advanced programmers though. I started something along the lines of this myself a looong time ago, but was only able to get partial support for it working.
Generally, you can safely safe that if fred doesn't provide for having itself run in a client window of another app (typically this would be done via OLE/Com/ActiveX), the effort for making it do that anyway, are probably not going to be worth it.
October 29th, 2003, 02:14 PM
I don't suppose there's an
ActiveX control written for just this purpose?
In other words, add an ActiveX control to a dialog (or CFormView, in my case) which would handle running the foreign app itself.
October 29th, 2003, 04:18 PM
I think OReubens means that fred.exe would be written to act as both a stand alone EXE, and as an ActiveX control.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!