There is SetParent API which you can use. You probably find an example just by searching the forums for SetParent EXE