I have a form and a panel within the form and this is my code to handle the setparent which works fine.
hWnd = FindWindow("MapleStoryClass", null);
Panel_Handle();
SetParent(hWnd, PanelHandle);
SetWindowPos(hWnd, (IntPtr)SpecialWindowHandles.HWND_TOP,
-3, -25, 800, 600, SetWindowPosFlags.SWP_NOSIZE);
The only question I have is how can I determine whether or not setparent worked via code? I understand I can visually check that setparent worked fine, but I need to input a check in my code to see if setparent worked.
You can try using the GetParent WinApi function.
From above Link: