1. Create an MDI application using the wizard 2. Create onCreate for CChildFrame to handle the WM_CREATE message. 3. Edit CchildFrame :: oncreate () from the mainfrm.cpp from the mainfrm.cpp from the mainfrm.cpp CCHILDFRAME :: onCreate () Copy the following code :
IF (! m_wndstatusbar.create (this) ||! m_wndstatusbar.setindicators (INDICATORS, SIZEOF (INDICATORS) / SIZEOF (TRACE0 ("Failed to create status bar / N"); return -1; // Can create}
4. Copy the top MAINFRM.CPP following definitions and declarations CHILDFRM.CPP to the top, that is, after END_MESSGE_MAP () macro: static UINT indicators [] = {ID_SEPARATOR, // status line indicator ID_INDICATOR_CAPS, ID_INDICATOR_NUM, ID_INDICATOR_SCRL,};
5. Add the following publicfrums to the childfrm.h: cstatusbar m_wndstatusbar in cchildframe;
6. Compile and run the program to see a status bar in each MDI sub-window.