Results 1 to 2 of 2

Thread: Display App Within Form Window

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Australia
    Posts
    33

    Question Display App Within Form Window

    Hi

    Is it possible to open an application and display an application`s window within a VB form?

    ie. Open Word and display the entire Word program in a form`s active window.


    Any help would be appreciated


    Thanks

    Gregg

  2. #2
    Matthew Gates
    Guest
    Use the SetParent API function. Here is an example:


    Code:
    Private Declare Function FindWindow Lib "user32" _
    Alias "FindWindowA" (ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long
    
    Private Declare Function SetParent Lib "user32" (ByVal _
    hWndChild As Long, ByVal hWndNewParent As Long) As _
    Long
    
    
    Private Sub Form_Load()
        
        Dim NotePad As Long
        NotePad = FindWindow("notepad", vbNullString)
        If NotePad <> 0 Then
            SetParent NotePad, Me.hWnd
        End If
        
    End Sub

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