开发者

How to embed an executable program in another as if the iframe does in HTML

I have an existing GUI program named A. 开发者_开发百科How can I write another program in Visual C++ which hosts A as a CView or something similar. Just like a html inside another html using iframe. Thank you.


Yes it is possible to do that, However you would have to provide a container control on the hosting application. I embedded Google Earth into a tracking app I was developing in C# with a similar method.

Method

  1. Use Windows Hook to capture program "A" on process start.
  2. Use spy++ to find out the window handle for "A"
  3. Use SetWindowPosEx function to make your host container the parent for "A"

*NB The windows hook will be a global hook so the code has to be bullet proof, and the hooking code must reside in a .dll file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜