CMDIFrameWnd *m_frame = (CMDIFrameWnd *)AfxGetMainFrame();
HWND hwnd;
hwnd=::GetWindow(m_pMDIFrame->m_hWndMDIClient, GW_CHILD);
CString str = "Ventanas abiertas :";
while (hwnd != NULL)
{
TCHAR titulo[256];
::GetWindowText(hwnd,titulo,sizeof(titulo)/sizeof(titulo[0]));
str += titulo;
str += "\n";
hwnd =::GetWindow(hwnd ,GW_HWNDNEXT);
}
MessageBox(str);