CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 1999
    Posts
    91

    Question How to add a form of another application in your mdiform?

    Hi,

    How to add a form of another application in your mdiform?
    I want a form from an activex .exe application to act like an mdi child in my mdiform.


    Regards,

    Maurice

  2. #2
    Join Date
    Sep 2001
    Location
    Québec, Canada
    Posts
    1,923

    Post

    Look for the API SetParent:

    http://www.codeguru.com/forum/showth...hreadid=219863

    JeffB
    CodeGuru VB FAQ Visual Basic Frequently Asked Questions
    VB Code color Tool to color your VB code on CodeGuru
    Before you post Importants informations to know before posting

  3. #3
    Join Date
    Aug 1999
    Posts
    91
    This will not work since the help about the SetParent function says:
    The new parent window and the child window must belong to the same application.

  4. #4
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477
    Microsoft might just want us to believe that, but from experience I know that it is possible to plae other applications inside a MDI window. There are a few limitations, like Messageboxes, modal forms and system windows, like the desktop and the taskbar.
    Tom Cannaerts
    email: cakkie@cakkie.be.remove.this.bit
    www.tom.be (dutch site)

  5. #5
    Join Date
    Aug 1999
    Posts
    91
    Hi Cakkie,

    The only API I need is SetParent or do I need more API's to do what I want?
    Can you point me in the correct direction?

    Maurice

  6. #6
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477
    You will need to get the hwnd (handle of window) of the window you want to make your parent.
    This can be done using one of numerous window API calls, like Findwindow. Once you have the hwnd you want, you just need to call the setparent. It will accept the hwnd of the window you want, and the hwnd of the new parent window. In this case that would be you MDI form. Each form in VB has a hwnd property, so no API calls are needed to get that one.
    Once you call the setparent, the window will appear inside the MDI form.
    Tom Cannaerts
    email: cakkie@cakkie.be.remove.this.bit
    www.tom.be (dutch site)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured