I do remember that although the code worked, the form did not resize itself
correctly and was not easy to hide/shutdown on request.
Does anybody have a any code snippets that would allow me to control an external
exe in much the same way as a frame or panel? I have full source control over
both the parent and child applications, if that makes things any easier.
Any help would be really appreciated
Mark
There are no good search keywords to find it with, unfortunately. Basically "all"
you need to do is to get the handle of the external apps window (via FindWindow,
for example). Once you have that handle you can move and resize the window using
the MoveWindow API function to give the appearance of it being a child window in
your app (you can actually parent it to one of your forms using Windows.SetParent,
but that tends to interfere with its function). You can send it WM_NCACTIVATE
messages to make its caption bar appear in the active or inactive color, as you
please.
> I do remember that although the code worked, the form did not resize itself
> correctly and was not easy to hide/shutdown on request.
All a matter of how you code both apps.
>
> Does anybody have a any code snippets that would allow me to control an external
> exe in much the same way as a frame or panel? I have full source control over
> both the parent and child applications, if that makes things any easier.
It makes it a *lot* easier since this requires support code on both ends to
make it work smoothly. Define a message-based communication interface between the
apps, so A can tell B when it needs to resize its window, for example.
If you control both apps, by the way, why don't you redesign the one to embed as a
package (a plugin design)? You can then create the embedded apps forms as part of
your application, with much less hassle than your current approach.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Thank you for that, Peter. I will try and make a set of classes to handle it
automatically and post the results if they are stable.
In answer to your other point, I've never really liked packages, they are not
language independant in the way com, dll and this method is. The trouble with
DLL's and COM objects is they can be fairly hairy to debug, but with EXE's it's
simple.
Good luck!
>
> In answer to your other point, I've never really liked packages, they are not
> language independant in the way com, dll and this method is. The trouble with
> DLL's and COM objects is they can be fairly hairy to debug, but with EXE's it's
> simple.
True. But in this particular case you buy other problems with the EXE approach.
The only real support Windows has for this "embed one EXEs window into another"
scheme are Ole document servers (which you can embed in a TOleContainer). But
that is a wholly different kettle of snakes (highly venomeous ones)...