Status Bar Example Program in VC++

#include<afxwin.h>
#include<afxext.h>

class Frame : public CFrameWnd {
public:
   CStatusBar StatusBar;
   unsigned int Indicators[4];
   char Points[20];

   Frame() {
      Create(0, "Status Bar");
   }

   int OnCreate(LPCREATESTRUCT Var) {
      StatusBar.Create(this);
      Indicators[0] = 0;
      Indicators[1] = ID_INDICATOR_CAPS;
      Indicators[2] = ID_INDICATOR_NUM;
      Indicators[3] = ID_INDICATOR_SCRL;
      StatusBar.SetIndicators(Indicators, 4);
      return 1;
   }

   void OnMouseMove(UINT Flag, CPoint Point) {
      sprintf(Points, "X = %d  Y = %d", Point.x, Point.y);
      StatusBar.SetPaneText(0, Points);
   }

   DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(Frame, CFrameWnd)
ON_WM_CREATE()
ON_WM_MOUSEMOVE()
END_MESSAGE_MAP()

class Applet : public CWinApp {
public:

   int InitInstance() {
      Frame *Pointer = new Frame();
      Pointer->ShowWindow(3);
      m_pMainWnd = Pointer;
      return true;
   }
};
Applet Instance;