SetParent (user32)
Last changed: -158.255.168.220

.
Summary

C# Signature:

[DllImport("user32.dll")]
static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);

VB Signature:

Declare Auto Function SetParent Lib "user32" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr)

User-Defined Types:

None.

Notes:

Use with FindWindow/FindWindowEx to find the window you wish to place in the form as a child.

Tips & Tricks:

Use this to create forms and then place child windows on it.

Sample Code:

SetParent(FindWindow(vbnullstring,"notepad.exe"),me.handle)

Alternative Managed API:

MDIParent and MDIChild do work for interforms.

Documentation
SetParent on MSDN