How do i inform a win32 subwindow that parent windows is closing?

I use SDL as parent window and create a win32 subwindow.
When i close win32 window,
the process created by win32 windows can be terminate correctly.
But when i close SDL parent window,
win32 subwindow will close,but it will not terminate the process it created.
Does anyone one know what’s wrong?
Below is terminate process code in WndProc() when win32 window closed
case WM_CLOSE:
CloseHandle( pi.hProcess );

WS Liu