VB Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Dim ChildhWnd As Long
Private Sub Command1_Click()
Dim strCaption As String
strCaption = String(100, Chr$(0))
GetWindowText ChildhWnd, strCaption, 100
MsgBox strCaption
End Sub
Private Sub Form_Load()
Dim frm As Form
Set frm = Form2
SetParent frm.hwnd, Frame1.hwnd
frm.Show
ChildhWnd = frm.hwnd 'store for later
End Sub