How to insert a window of another application (for example Notepad) into my WinForm app? I am using the SetParent, but focus of my app disappears. If the embedded window set WS_CHILD style it does not receive focus.
int style = GetWindowLong(_childHWnd, GWL_STYLE);
RECT rect = new RECT();
GetClientRect(_parentHWnd, out rect);
SetParent(_childHWnd, _parentHWnd);
SetWindowPos(_childHWnd, IntPtr.Zero, 0, 0, rect.Width, rect.Height, 0);
SetWindowLong(_childHWnd, GWL_STYLE, style);