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
Printable View
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
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