How do I terminate a process which was created by CreateProcess function?

Here is what I got so far:

void CMFPView::OnFaxEditor()

{

STARTUPINFO sinfo = {sizeof(sinfo), NULL, NULL, NULL, NULL, NULL, NULL,

NULL, NULL, NULL, NULL, STARTF_USESHOWWINDOW, SW_SHOW, 0, NULL,

NULL, NULL, NULL};

PROCESS_INFORMATION pinfo;

CreateProcess(NULL, "d:\\mfp\\faxNumStg-VB\\faxNumStg.exe",

NULL,NULL,FALSE,CREATE_DEFAULT_ERROR_MODE,NULL,NULL,

&sinfo,&pinfo);

}

The faxNumStg AP doesn't terminate unless user choose to close the AP. If user did not close faxNumStg AP, how do I

terminate faxNumStg AP automatically when the calling AP was terminated. Any suggestion would be greatly appreciated.

Thanks in advance.


Best Regards,

Tiffany Chen