Do you mean something like this?void DoTest(HWND hWnd)
{
WinExec(TEXT("notepad.exe"), SW_HIDE);
Sleep(500);
HWND hWndChild = FindWindow(TEXT("Notepad"), NULL);
SetParent(hWndChild, hWnd);
RECT rect;
GetClientRect(hWnd, &rect);
MoveWindow(hWndChild, 0, 0, rect.right, rect.bottom, 0);
ShowWindow(hWndChild, SW_SHOW);
}