Cascading specific windows in a MFC MDI application
-
A MDIParent Wnd has many MDIchild Wnds, and also few child dialogs. Dialogs are created this way --- CAutoDlg *pDlg = new CAutoDlg; pDlg->Create(IDD_AUTOCARD,this); I want to cascade only a specific type of dialogs, say dialogs of CAutoDlg type only. If i give MDICascade() it cascades all the child windows and dialogs under the MDIFrame. Is there any other un-conventional way other than calling SetWindowPos for each dialog, based on the position of the previous dialog?
-
A MDIParent Wnd has many MDIchild Wnds, and also few child dialogs. Dialogs are created this way --- CAutoDlg *pDlg = new CAutoDlg; pDlg->Create(IDD_AUTOCARD,this); I want to cascade only a specific type of dialogs, say dialogs of CAutoDlg type only. If i give MDICascade() it cascades all the child windows and dialogs under the MDIFrame. Is there any other un-conventional way other than calling SetWindowPos for each dialog, based on the position of the previous dialog?
Elsie wrote:
Is there any other un-conventional way other than calling SetWindowPos for each dialog
Not that I know of, but it should be fairly simple to write your own cascading. Write a function that takes the type of window as parameter (typically CAutoDlg) and iterate over all your child frames/dialogs and position the ones inheriting from the supplied base type using IsKindOf().