Results 1 to 9 of 9

Thread: Outside applications inside MDI

Threaded View

  1. #6
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Outside applications inside MDI

    Thanks.
    For the dragging problem on the new 'MDIChild', I found something like this in EE.
    But it still doesn't act like 'normal MDIChild'. Maximize Form2 and the titlebar doesn't merge with MDI.
    VB Code:
    1. ' Needs 2 forms. Form1 is MDIChild and startup form.
    2. ' Place one button in Form1
    3.  
    4. ' Inside Form1
    5. Option Explicit
    6. Private Declare Function SetParent Lib "user32" ( _
    7.     ByVal hWndChild As Long, _
    8.     ByVal hWndNewParent As Long) As Long
    9. Private Declare Function SetWindowLong Lib "user32" _
    10.     Alias "SetWindowLongA" ( _
    11.         ByVal hwnd As Long, _
    12.         ByVal nIndex As Long, _
    13.         ByVal dwNewLong As Long) As Long
    14. Private Declare Function GetWindowLong Lib "user32" _
    15.     Alias "GetWindowLongA" ( _
    16.         ByVal hwnd As Long, _
    17.         ByVal nIndex As Long) As Long
    18. Private Const GWL_STYLE = (-16)
    19. Private Const WS_CHILD = &H40000000
    20.  
    21. Private Sub Command1_Click()
    22.     Dim m_oldstyle As Long
    23.     Load Form2
    24.     SetParent Form2.hwnd, MDIForm1.hwnd
    25.     m_oldstyle = GetWindowLong(Form2.hwnd, GWL_STYLE)
    26.     Call SetWindowLong(Form2.hwnd, GWL_STYLE, (m_oldstyle Or WS_CHILD))
    27.     Form2.Show vbModeless
    28.     Form2.Move 0, 0
    29. End Sub
    Last edited by iPrank; Apr 4th, 2006 at 10:08 AM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


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