2

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.

Daniel Silveira
  • 41,125
  • 36
  • 100
  • 121

3 Answers3

3

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.

Community
  • 1
  • 1
Reed Copsey
  • 554,122
  • 78
  • 1,158
  • 1,373
1

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.

  • There are many examples of this working online, though. For example, see: http://www.codeproject.com/KB/vb/ByPassAutomation.aspx?display=Print – Reed Copsey Mar 28 '09 at 13:57
  • 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 Mar 28 '09 at 13:58
1

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
  • 112,638
  • 29
  • 165
  • 179