You can find all Children with EnumChildWindows(...) and then close they with SendMessageTimeout(hwnd, WM_CLOSE, ...).
A sample:
BOOL CALLBACK FindChildWindowProc( HWND hwnd, LPARAM lParam )
{
DWORD dwResult;
::SendMessageTimeout( hwnd, WM_CLOSE, 0, lParam, SMTO_NORMAL, 4000, &dwResult );
}
......
//In another Function, hwnd is the Handle of Your Dialog's main Window.
EnumChildWindows(hwnd, FindChildWindowProc, 0);