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
- Use Windows Hook to capture program "A" on process start.
- Use spy++ to find out the window handle for "A"
- 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.
精彩评论