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

**URL:** <https://discourse.libsdl.org/t/how-do-i-inform-a-win32-subwindow-that-parent-windows-is-closing/17396>\
**Category:** SDL Development\
**Created:** [May 31, 2010, 1:51am UTC](https://discourse.libsdl.org/t/how-do-i-inform-a-win32-subwindow-that-parent-windows-is-closing/17396 "2010-05-31T01:51:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![psboy](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/p/e56c9b/32.png) [@psboy](https://discourse.libsdl.org/u/psboy)\
**Post date:** [May 31, 2010, 1:51am UTC](https://discourse.libsdl.org/t/how-do-i-inform-a-win32-subwindow-that-parent-windows-is-closing/17396/1 "2010-05-31T01:51:22Z")

</div>

Hi  
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:  
TerminateProcess(pi.hProcess,0);  
CloseHandle( pi.hProcess );  
break;–  
Greets

WS Liu
