RE: Closing All Open Dialogs
"SaranG(Saravanan)" wrote:
Hi all,
I am developing Dialog based application.This application
contains so many no. of dialogs. So i need to close all open dialogs
when i click the button in one dialog like named "Close All". I tried
with OnCancel and OnOK both this will close only one dialog of which i
called from. So any one can help me.
Thanks in advance,
SaranG.
Sorry, in my previously sent reply was something missing !
/*===================================================
OnClose ( CPropertySheet )
=====================================================*/
void CpshXXXX::OnClose()
{
WORD i;
if( strcmp(m_pClassParent->m_lpszClassName, "CppXXXXUeR" ) == 0 )
{ // CPropertyPage parent
CppXXXXUeR* pDaten = (CppXXXXUeR*) m_pParent;
if( pDaten->m_pPropPages[i]->m_hWnd != NULL )
{ // send a close message to the child ( CPropertyPage )
for( i = 0; i < 3; i++ )
{ CWnd* pChildWnd = FromHandle( pDaten->m_pPropPages[i]->m_hWnd );
pChildWnd->SendMessage( WM_CLOSE, 0, (LPARAM)0 ); }
}
}
else
{ if( strcmp(m_pClassParent->m_lpszClassName, "CppXXXXStR" ) == 0 )
{ // Another CPropertyPage parent
CppXXXXStR* pDaten = (CppXXXXStR*) m_pParent;
for( i = 0; i < 3; i++ )
{ if( pDaten->m_pPropPages[i] != NULL )
{ if( pDaten->m_pPropPages[i]->m_hWnd != NULL )
{ // send a close message to the child ( CPropertyPage )
CWnd* pChildWnd = FromHandle(
pDaten->m_pPropPages[i]->m_hWnd );
pChildWnd->SendMessage( WM_CLOSE, 0, (LPARAM)0 ); }
}
}
}
}
CPropertySheet::OnClose();
}
Regards
werner m...