I'm writing an application in C# which needs to attach one of its own windows to a window owned by another process. I tried using the SetParent function from the windows api, but it doesn't seem to work. Is there any way to do this?
[DllImport("user32.dll", SetLastError = true)]
private static extern int SetParent(int hWndChild, int hWndNewParent);
private void AttachWindow(int newParent) {
SetParent(this.Handle, newParent);
}