Create Status bar for a Child Window
Creating status bar for your MDI application's child window is quite similar to Toolbar.
Step 1: Create an MDI application and override OnCreate function of its CMDIChildWnd derived class ( default CChildFrame ).
Step 2: Add CStatusBar m_wndStatusBar; in its header file.
Step 3: Add this code just after your ChildFrame's Message map.
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
Step 3: Write this code on its OnCreate function.
if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndStatusBar.SetWindowText ("Mahesh: This is new status bar");
Run and Execute your application. You are all set.