tags:

views:

252

answers:

3

Is it possible to start a new process and set it's main window as a child window of my MDI application?

The scenario is: I have a MDI application and I want to start Adobe Acrobat as a child window of my MDI application.

+3  A: 

In theory, I believe it's possible using SetParent.

However, in practice, this may be a bit more difficult than you'd expect. Also, you'll need to do work to syncronize the styles, etc.

Just a thought, though - If you are trying to embed Acrobat Reader (not full Acrobat), you may be able to do this easier by embedding a webcontrol and having the acrobat reader plugin used in that...


Here are some samples of people making this work (at least partially):

Related SO question with workarounds for specific issues.

CodeProject article using SetParent

Experts-exchange question about embedding a java app in a win32 app.

Reed Copsey
+1  A: 

I don't believe this is possible, at least not using SetParent. To quote from the SetParent documentation:

An application can use the SetParent function to set the parent window of a pop-up, overlapped, or child window. The new parent window and the child window must belong to the same application.

anon
There are many examples of this working online, though. For example, see: http://www.codeproject.com/KB/vb/ByPassAutomation.aspx?display=Print
Reed Copsey
That being said, I don't think it's a very good idea in general, but it does appear to be a way to work.
Reed Copsey
+1  A: 

I don't think what you want is easily done, but it could be an option to try to integrate one of the open-source PDF-viewers (if you're prepared to go GPL as that is probably the license on most of them). Some links:

ChristopheD