your parent class is CParentDlg. It has two children CChildDlg1 and CChildDlg2.
Keep CChildDlg1 and CChildDlg2 pointer type as members of CParentDlg class as below
class CParentDlg : public CDialog
{
.......
private:
CChildDlg1* m_pDlg1;
CChildDlg2* m_pDlg2;
.......
}
now from the CParentDlg class constructor initialze m_pDlg1 and m_pDlg2 to 0
CParentDlg::CParentDlg(..)
{
...
m_pDlg1 = 0; m_pDlg2 = 0; ...
}
now from the CParentDlg class some function create both the children dialog as modeless dialog
void CParentDlg::ChildrenCreation()
{
.......
m_pDlg1 = new CDialog;
m_pDlg1->Create( IDD_CHILD1 );
m_pDlg1->ShowWindow( SW_SHOW );
m_pDlg1->UpdateWindow();
.......
m_pDlg2 = new CDialog;
m_pDlg2->Create( IDD_CHILD1 );
m_pDlg2->ShowWindow( SW_SHOW );
m_pDlg2->UpdateWindow();
}
now i just show you the example to move the window. For resizing and all other mouse operation u can try urself similarly.
void CParentDlg::OnMove( int x, int y )
{
.....
if( m_pDlg1 != 0 ) {
m_pDlg1->MoveWindow( urDesiredx1, urDesiredy1, urDesiredWidth, urDesiredHeight )
}
if( m_pDlg2 != 0 ) {
m_pDlg2->MoveWindow( urDesiredx1, urDesiredy1, urDesiredWidth, urDesiredHeight )
}
}
You can overrride the OnMove() method of your children dialog if you want to do something in addition on receiving this message. You can do the same using
SendMessage() also. But i prefer this way