It seems not everything can be solved by normal windows api.
Like WaitForInputIdle(), even it works well. Like while()-slee() insead. There is still a problem there.
After I got the handle to window class of the new child process's thread's window.
When I move the child process 's window, it can cause dead-lock with some unclear reason.
Because I don't know the routine of the child process window's initiation.
The parent process operating on SetWindowLong(m_hWndChild, ... ) caused the child gui program into dead-lock state
in some sistuations, not always.
I should really hijack api.