Write a window class dervied from CWnd. class MdiClient : public CWnd { DECLARE_DYNAMIC( MdiClient ) public: // Construction/Destruction MdiClient(); protected: // ClassWizard generated message map functions //{{AFX_MSG( MdiClient ) //}}AFX_MSG afx_msg LRESULT OnMDICreate( WPARAM, LPARAM lParam ); afx_msg LRESULT OnMDIDestroy( WPARAM wParam, LPARAM ); DECLARE_MESSAGE_MAP() int m_nMDICount; }; IMPLEMENT_DYNAMIC( MdiClient, CWnd ) // Construction/Destruction MdiClient::MdiClient() : m_nMDICount( 0 ) { } // ClassWizard generated message map functions BEGIN_MESSAGE_MAP( CLASS, BASE ) //{{AFX_MSG_MAP( MdiClient ) //}}AFX_MSG_MAP ON_MESSAGE( WM_MDICREATE, OnMDICreate ) ON_MESSAGE( WM_MDIDESTROY, OnMDIDestroy ) END_MESSAGE_MAP() LRESULT MdiClient::OnMDICreate( WPARAM, LPARAM lParam ) { LPMDICREATESTRUCT lpmdic = (LPMDICREATESTRUCT)lParam; HWND hwndMDIChild = (HWND)CWnd::DefWindowProc( WM_MDICREATE, 0L, (LRESULT)lpmdic ); if ( hwndMDIChild != NULL ) { ++m_nMDICount; // Reposition the MDI childs like you want } return (LRESULT)hwndMDIChild; } LRESULT MdiClient::OnMDIDestroy( WPARAM wParam, LPARAM ) { --m_nMDICount; if ( m_nMDICount > 0 ) { // Reposition the MDI childs like you want } return CWnd::DefWindowProc( WM_MDIDESTROY, wParam, 0L ); } 2) Derive a class from CMDIFrameWnd, and overwrite OnCreate. int MdiFrameWnd::OnCreate( LPCREATESTRUCT lpCreateStruct ) { if( CMDIFrameWnd::OnCreate( lpCreateStruct ) == -1 ) { return -1; } m_pwndMdiClient = new MdiClient; if( !m_pwndMdiClient->SubclassWindow( m_hWndMDIClient ) ) { return -1; } return 0; } HTH Martin