Accessing the MDI Parent Window

The function CMDIChildWnd::GetParentFrame() returns a pointer to the MDI parent frame window for the child. Use this function rather than the normal Windows API function GetParent. Since GetParentFrame is declared to return a pointer to a CFrameWnd object, you will have to typecast the result to a CMDIFrameWnd object. For an example of how to use GetParentFrame, see the next section, “Changing Frame Window Menus to Match MDI Child Windows.”