tags:

views:

307

answers:

3

I wanted to create a program that would allow me to open instances of a already exsiting program (i just have the exe) as windows inside (i belive its called mdi)

Is that something i could do? can anyone point me to an example?

Thanks

A: 

When Windows starts a program its parent is the Desktop Window.

If you could somehow manipulate that, it may work.

However, I doubt it is possible, as why would I want to allow you to run my application in your window? Especially MDI? Besides that - running in a child window isn't quite the same as running in the "main" window.

Having said that there is an application out there (can't think of it's name OH) that does place individual applications in tabs. Pretty nifty if you're not on Windows 7. The folks over at the Business of Software forum might be able to help you find it.

+1  A: 

Maybe this is the answer you are looking for here. It can be done...look in the sample on that link given.

Hope this helps, Best regards, Tom.

tommieb75
A: 

Well, after starting the app and storing its PID, you could start monitor the windows that get created, either thru a CBTHook or by just using a timer and the GetWindows to find when a top level window gets created by the PID in question.

Then you can use SetParent to make that window a child to your MDIChild (I doubt you can make it your MDIChild directly).

That should get you going. What you'll run into after that I really don't know. I guess you must correlate any movement of either your app or the external app so that thir windows appears to be stuck together...

Maybo you could strip away the caption from the external app (Get/SetWindowsLong). That could make it look better...

danbystrom