pspwxp fan 1 Junior Poster in Training

Hi,
I'm making a windows console application that can create and terminate processes, and stores their start and end time. It works fine as long as I start and end the processes from my application itself. However, if I close the child process, eg notepad, using it's own 'X' button, then obviously its start and end time does not get recorded.

I want to know if it's possible to block the child process from terminating upon clicking the X button. If that's not possible, then is there a way to catch the event of this process terminating in my application, so I can record it's information.

Thanks!