Using MSVC 5 w/ MFC, how does one incorporate a MinimizeAll method for a MDI implmentation? The more detailed question is how to iterate on MDI children and guarantee you will hit them all?
This was suggested...
You can get the active MDI child by calling CMDIFrameWnd.MDIGetActive(). Then you can iterate using pMDIChild->GetWindow(HWND_NEXT) sending messages or calling member functions as you like.
Which is what I actually had done, but there is a problem...
CMDIChildWnd* pMDIChild = MDIGetActive();
CMDIChildWnd* pFirstActive = pMDIChild;
pMDIChild->CloseWindow(); // Minimizes
pMDIChild = (CMDIChildWnd*)pMDIChild->GetNextWindow();
if (pMDIChild == pFirstActive)
However this will not actually do the job. If any window is activated other than the last, the loop will not hit each child. There is probably something wrong w/ the loop termination criteria, but something has to be there or the iteration will never terminate. The fundamental issue witht he suggested approach is that the 1st window in the window management list is not the same as the active MDI child, so iterating from active window forward doesn't guarantee all children are processed (at least w/ my loops above)